Sign in to follow this  
chayanvinayak

gluPerspective() OpenGL

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this