Game Development Reference
In-Depth Information
When we modify the following three lines of the previous example's present() method,
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0, -2, 0);
with these four lines,
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0, -3, 0);
gl.glRotatef(45, 1, 0, 0);
we get the output shown in Figure 10-17 .
Figure 10-17. Looking down at our world from (0,3,0)
Conceptually, our camera is now located at (0,3,0), and it looks down at our scene at a −45
degree angle (which is the same as rotating the camera by −45 degrees around the x axis).
Figure 10-18 shows the setup of our scene with the camera.
Figure 10-18. How the camera is positioned and oriented in the scene
 
Search WWH ::




Custom Search