Jump to content
  • Advertisement

Archived

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

Mr Lane

Quick question

This topic is 5232 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!