Perspective question
Hello
Im trying to make a horizontal shooter a la R-Type, Gradius, etc.
I load my model (spaceship) at coord 0, 0, 0.
My problem is that when i translate the ship, i see the "perspective" (if it moves left, the front of the ship is visible, right, the ship''s engine are visible)
i dont want that
i want the ship to stay "still".
init:
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.0f,(GLfloat)width/(GLfloat)height, .5f ,1024.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
rendering:
gluLookAt(0, 0, 300, 0, 0, 0, 0, 1, 0);
glTranslatef(xpos,0,0);
thanks
-Oli
The problem is that the call to gluPerspective sets up a 'perspective' projection matrix. What you seem to want is an Orthographic matrix. So you would switch gluPerspective() to glOrtho().
Edit: added code tags
[edited by - jwace81 on September 26, 2003 7:03:14 PM]
void glOrtho( GLdouble left, // left clip plane GLdouble right, // right clip plane GLdouble bottom, // bottom clip plane GLdouble top, // top clip plane GLdouble near, // near clip plane GLdouble far // far clip plane);
Edit: added code tags
[edited by - jwace81 on September 26, 2003 7:03:14 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement