gluLookAt-meets-skybox...
Hi folks,
I''m working on a space game, and having got my skybox working I discovered I had the problem others have described (gimble lock?) with my camera rotation code, which was a simple - so now I''m using Eoin Hennessy''s excellant 6DOF camera class (Eoin Hennessy), which essentially behaves like gluLookAt.
The problem is, I can''t get the skybox to render anymore, because I need to be able to translate to the camera position, render the skybox, then do the camera rotation - but this method rolls the translation and rotation into one.
Anyone got any cunning ideas? I tried
glPushMatrix();
glTranslatef(cam.eye.x, cam.eye.y, cam.eye.z);
sky.Render();
glPopMatrix();
cam.Update; // This does both the translation and rotation
- but to no avail. If I understood the maths behind the transformation matrix Eoin uses well enough I''m sure I could split the cam.Update() method into two parts, but I''m totally lost.
Thanks for any help anyone can offer. I don''t *have* to use this camera, but I need a way of full 6DOF that still lets me use a skybox.
Best regards,
Iain
-=aSe=-
What do u mean with "I can''t get the skybox to render anymore"
in my code, i''m rotating and translating the cam via gluLookAt
after that i''m drawing the skybox like this
pseudo-code)
glPushMatrix();
glTranslatef(campos.x,campos.y,campos.z);
draw_front_face();
draw_right_face();
draw_back_face();
draw_left_face();
glPopMatrix();
I hope it''ll help u.
in my code, i''m rotating and translating the cam via gluLookAt
after that i''m drawing the skybox like this

glPushMatrix();
glTranslatef(campos.x,campos.y,campos.z);
draw_front_face();
draw_right_face();
draw_back_face();
draw_left_face();
glPopMatrix();
I hope it''ll help u.
hey, life has to go on
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement