Making the square rotate Let's start by making the square rotate. The first thing we'll need is a variable in which to track the current rotation of the square: var squareRotation = 0.0 ; Now we need to update the drawScene() function to apply the current rotation to the square when drawing it. After translating to the initial drawing position for the square, we apply the rotation like this: mat4 . rotate ( modelViewMatrix , // destination matrix modelViewMatrix , // matrix to rotate squareRotation , // amount to rotate in radians [ 0 , 0 , 1 ] ) ; // axis to rotate around This rotates the modelViewMatrix by the current value of squareRotation , around the Z axis. To actually animate, we need to add code that changes the value of squareRotation over time. We can do that by creating a new variable to track the time at which we last animated (let's call it then ), then adding the followi...