Jump to content
  • Advertisement
Sign in to follow this  
sunrisefe

why the teapot not reversal?

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

the glOrtho function :if zNear is negative then the near clipping-plane( also observing plane) is behind the viewpoint and the object we see will be upside-down. but my demo contract with it. here, the viewpoint is (0.0, 0.0, 5.0),so i set the near clipping-plane's z=6, but the result is same as the ones that set the near clipping-plane's z=-0.5.. why not upside-down? thank you void glOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar ); **************my demo******************** void display(void) { glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 1.0, 1.0); glLoadIdentity (); /* clear the matrix */ /* viewing transformation */ gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glutWireTeapot(0.5);//the object to display glFlush (); } void reshape (int w, int h) { glViewport (0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode (GL_PROJECTION); glLoadIdentity (); glOrtho(-1.0,1.0,-1.0,1.0,-6.0,20.0); glMatrixMode (GL_MODELVIEW); } [Edited by - sunrisefe on September 17, 2007 3:23:46 AM]

Share this post


Link to post
Share on other sites
Advertisement
i am on the way to studying the OPENGL programing, so i meet many problems ,i hope some warm-hearted people would give me some suggestion and help. thank you all.

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!