Still, we don't add any codes for mouse dragging, so the cube's just showing the front face. </br>
</p>
<h3></br></br>Step3. Add some codes so that the mouse can drag the cube!</h3>
<p>
It's almost done!</br>
In this step, we will use <code>EventListener</code> of JS and HTML DOM event.</br></br>
We need 3 functions, <code>Downward</code>, <code>upward</code>, <code>Moving</code>, and 1 variable <code>drag</code>.</br></br>
When you clicked the canvas, the <code>Downward</code> function will be run. </br>
<code>Downward</code> stores the dragging point's coordinate values. </br>
The dragging point is the starting point of the mouse movement.</br>
Using <code>pageX</code> and <code>pageY</code>, we can get the dragging point's coordinate values. </br>
Each coordinate values will be stored to <code>original_x</code> and <code>original_y</code>.</br>
And make the <code>drag</code> value to <code>true</code>.</br></br>
When you don't click the canvas, the <code>Upward</code> function will be run. </br>
<code>Upward</code> do nothing except changing the <code>drag</code> value to false. </br></br>
When you move your mouse, the <code>Moving</code> function will be run. </br>
<code>Moving</code> gets the mouse's new coordinates. </br>
Then, using the <code>original_x</code>, <code>original_y</code>, <code>pageX</code> and <code>pageY</code>, we will get <code>gap_x</code> and <code>gap_y</code>. </br>
These two values, <code>gap_x</code> and <code>gap_y</code>, is the difference between original coordinates and new coordinates(present coordinates). </br>
Using <code>gap_x</code> and <code>gap_y</code>, we will change the <code>x_rad</code> and <code>y_rad</code>. </br>
But, when you don't dragging and just moving your mouse cursor,