this is related to The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000?
I tried
gluLookAt(512, 384, 2000,
512, 384, 0,
0.0f, 1.0f, 0.0f);
and things work fine, and now I change the 3rd row (the UP vector), last number to 0.8
:
gluLookAt(512, 384, 2000,
512, 384, 0,
0.0f, 1.0f, 0.8f);
and it is exactly the same... next I tried and modified the 3rd line, the first number to 0.8
:
gluLookAt(512, 384, 2000,
512, 384, 0,
0.8f, 1.0f, 0.8f);
Now the view is like it rotated 45 degree to the left. How does this UP vector work?
The up vector is used to create a cross product between the eye and centre vector supplied to gluLookAt.
From the GLKit headers on iOS, you can see the implementation as:
The accepted answer in this question How do I use gluLookAt properly? provides a good description of what the up vector actually impacts.