Similarly, if we want to rotate the camera, say, 45 degrees to the right, this would be equivalent to rotating the world 45 degrees to the left. Using glMatrix to achieve this, we can write the following:
mat4.rotate(modelViewMatrix, modelViewMatrix, 45 * Math.PI/180, [0, 1, 0]);
Similar to the previous section where we explored translations, in the Time for Action: Rotations in World Space vs Camera Space section, we will experiment with rotations in both world and camera spaces. Let's see this behavior in action!