Jump to content
  • Advertisement
Sign in to follow this  
chayanvinayak

gluPerspective() OpenGL

This topic is 2557 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

gluPerspective(45.0,(double)w / (double)h,1.0,200.0);

In gluPersepective() function we define near clipping. In most of the cases we define near clipping as 1.0 which means anything which is beyond 1.0 or which has Z co-ordinate value less than 1.0 will not be drawn then why are the primitives or points are drawn or visible in the screen which have -5.0( or any other negative value for Z-axis)

eg.

glBegin(GL_POINTS);
glVertex3f(10.0f, 20.0f, -5.1f);
glEnd();


Thanks

Share this post


Link to post
Share on other sites
Advertisement
In OpenGL the positive Z axis points out of the screen at you (although you can change this if you like).

Share this post


Link to post
Share on other sites
careful, the modelview matrix compounds, so if you translate and forget to reset to identity, your object will be located at places that are different from what you maybe expecting

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!