The camera is the user’s point of view. The first six buttons change the location of the camera: up and down, left and right, forward and backwards. The last four buttons change the direction in which the camera is pointing.
The camera is implemented as the global variable
camera
at the top of
threedimensions.cpp
.
It holds a location and a direction.
The ten functions
up
,
down
,
left
,
etc.
change the contents of the
camera
.
The
display
function gets the current contents of the camera
(the position and the direction) in the form of a matrix.
It then uses this matrix as the model view matrix.
The
View
holds the
EAGLView
and the 10 buttons.
threedimensions.cpp
main.m
GLAppDelegate
View
GLViewController
EAGLView
MainWindow.xib
GLViewController.xib