Jump to content
  • Advertisement

Archived

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

camcbri

OpenGL OpenGL Correctness Tip - help gettting it to work

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

Hi, I''m trying to follow one of the openGL correctness tips found in the red book and the MSDN, but am having no luck. The tip seems quite simple.. It is: do not do many operations on a single matrix. instead of using glRotate with a variable angle and incrementing the angle each frame, use glLoadIdentity then rotate by a fixed angle. For some reason, I simply don''t know how to make this work. If I use glLoadIdentity, I always get a .5 degree rotation around identity and that''s it. Each frame is the same. I must be placing the glLoadIdentity improperly, but I can''t figure out why. Can anyone tell me how to do this? thanks a ton! Yours might be bigger. Yours might be harder. BUT, mine is multi textured, bump-mapped, pixel shaded & fully user customizable!

Share this post


Link to post
Share on other sites
Advertisement
It''s saying that instead of doing this:
  
glLoadIndentity();
glRotate(angle,1.0f,0.0f,0.0f);
// Render

glRotate(angle,1.0f,0.0f,0.0f);
// Render

glRotate(angle,1.0f,0.0f,0.0f);
// Render


Do this:
  
glLoadIndentity();
glRotate(angle,1.0f,0.0f,0.0f);
// Render

glLoadIndentity();
glRotate(angle*2.0f,1.0f,0.0f,0.0f);
// Render

glLoadIndentity();
glRotate(angle*3.0f,1.0f,0.0f,0.0f);
// Render


That prevents a growth in the inaccuracies of floating point math.

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!