Jump to content
  • Advertisement


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


light and z-buffer

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

because of z-buffer troubles, i had to : gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,1000,50000); now, when i draw an object, i draw it at 1000 z-distance, like this: glLoadIdentity(); glPushMatrix(); glTranslatef(0,0,1000); int sc = 1000; glScalef (sc,sc,sc); of course i have to scale it otherwise is so small that can''t be seen. Object is correctly displayed, but the problem is with light: i tried to position light near the object, but probably i can''t understand where to, because the scene is quite dark ... glHorizon_Project


Share this post

Link to post
Share on other sites
when u scale something your normals become screwed up + u need to renormalize them. u can do it automatically in opengl, though i forget the syntax at the moment check tyhe lighting section of the faq


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!