Skip to main content
gamedev.net
🔒 Locked

Rotations

Started by khalligan Jan 27, 2004 at 8:08 AM 0 replies 200+ views
Original Post
khalligan
khalligan
Im writing a 3D modeller as part of my final year project. Im using the MFC with OpenGL for rendering the 3d models. The problem is with the setting up of the viewports, to get them to look in the correct direction (eg. Top, Front, Left). I''ve tried to use various glRotatef(..) to rotate the view correctly in each of the viewports OnDraw() member of the viewports classes. But this obviously isn''t working correctly Lately i thought of using a camera class to achieve this, but the viewports become more screwed up than before. Please Help, Thanks, Keith
tHiSiSbOb
tHiSiSbOb
Use the gluLookAt function. It allows you to set the camera's position and the direction in which it points. syntax is as follows :
gluLookAt(camera_x,camera_y,camera_z,look_at_x,look_at_y,look_at_z,0,1,0)  

The last three values make up the "up vector" which just defines which direction is up.
EDIT: Just to clarify, leave the "up vector" untouched.

[edited by - tHiSiSbOb on January 27, 2004 9:19:23 AM]
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.