Let's cover an example covering various camera types:
- Open the ch04_04_camera-types.html file in your browser. You will see something like the following:
- Go around the world using the sliders in Tracking mode. Cool, huh?
- Change the camera type to Orbiting mode and do the same.
- Check that besides the slider controls, both in Tracking and Orbiting mode, you can use your mouse and keyboard to move around the world.
- In this exercise, we have implemented a camera using two new classes:
- Camera: To manipulate the camera.
- Controls: To connect the camera to the canvas. The canvas will now receive mouse and keyboard events and pass them along to the camera.
- If you are curious, you can see the source code of these two classes in the common/js directory. We have applied the concepts explained in this chapter to build these two classes...