In 3D graphics, a camera allows you to navigate through the 3D space; it can be used to perform the rotation and displacement on any arbitrary axis. In OpenGL ES, there is nothing such as a camera. This has to be implemented programmatically. Implementing a camera is extremely simple. In fact, we do not require any specific OpenGL ES APIs for this and it's all about manipulating matrices. In this recipe, we will simulate a first person camera.
Reuse the last implement recipe and perform the following steps to implement the camera system:
.cppfile and define a
Cameraclass derived from
Object. This class contains three unit vectors:
Forward, which store directional ...