Advertisement

Changing NeHe's camera function to a gluLookAt function.

Started by May 07, 2006 02:01 PM
3 comments, last by Axesor 18 years, 9 months ago
As the title says, how do you change the way NeHe madehis camera to a gluLookAt function? Every timer I try this, it comes out wrong. :/ Can some one help? ~Thanks in advanced.
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward
could you please post the code of the NeHe camera?

thanks

--nathan
Advertisement
.............

This is the NeHe section right?

................. .. ...... .....

*sigh*

float rotx = 360.0f - cam.view.x;
float roty = 360.0f - cam.view.y;
glRotatef(rotx, 1,0,0);
glRotatef(roty, 0,1,0);
glTranslatef(-cam.pos.x, -cam.pos.y-crouch, -cam.pos.z);


Whereas the pos is define as

(UP):
cam.last_pos.x = cam.pos.x;
cam.last_pos.z = cam.pos.z;
cam.pos.x -= sinef(cam.view.y);
cam.pos.z -= cosf(cam.view.y);
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward
Thank you. I will try this out.
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward

This topic is closed to new replies.

Advertisement