PDA

View Full Version : The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000?



winterheat
05-17-2012, 04:02 AM
I am trying LookAt in OpenGL ES,


gluLookAt(512, 384, 2000,
512, 384, 0,
0.0f, 1.0f, 0.0f);

The second row is the Target's position... so I wonder, if I change the z from 0 to 1000 or -1000, shouldn't what is seen different? They turn out to be all the same, why is that?

menzel
05-17-2012, 06:44 AM
The first three values state the position the camera is located at, the second the position you look at. If you move the second point along the axis you're looking at, the viewdirection stays the same. The third vector defines the up vector of the camera and thus the rotation of the camera relative to the viewing direction.