Setting up a virtual camera for 3D rendering
Rendering a 3D scene is similar to taking a photograph with a digital camera in the real world. The steps that are taken to create a photograph can also be applied in OpenGL.
For example, you can move the camera from one position to another and adjust the viewpoint freely in space, which is known as viewing transformation. You can also adjust the position and orientation of the the object of interest in the scene. However, unlike in the real world, in the virtual world you can position the object at any orientation freely without any physical constraints, termed as modeling transformation. Finally, we can exchange camera lenses to adjust the zoom and create different perspectives the process is called projection transformation.
When you take a photo applying the viewing and modeling transformation, the digital camera takes the information and creates an image on your screen. This process is called rasterization.
These sets of matrices—encompassing...