Archived

This topic is now archived and is closed to further replies.

Mr Lane

Quick question

Recommended Posts

Mr Lane    178
I have 2 questions actually. The first is about the depth of the OpenGL frustum and how to chnage it. I am using glut this time around and the depth of view is realy close...how do i make it further. Second, when i resize my screen the world will not show up in the newly created space, it simply gets chopped off. This is mt reshaping code:
void reshape(int w, int h)
{
   glViewport (0, 0, (GLsizei) w, (GLsizei) h); 
   glMatrixMode (GL_PROJECTION);
   glLoadIdentity ();
   gluPerspective(65.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   glTranslatef (0.0, 0.0, -5.0);
   return;
}

Share this post


Link to post
Share on other sites
tHiSiSbOb    463
To set it further back, call gluPerspective and make the last parameter more than 20.0. For the second question, are the values of h and w correct?? Check that out and report back

Share this post


Link to post
Share on other sites