Jump to content
  • Advertisement

Archived

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

PCI

z-axis rotation problem with 3D world

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

I''ve just read the 3D-world tutorial on Nehe, and decided I would try and recreate it alittle to help me learn it and how it works. I didnt use the data file, just moving the camera about the screen, so instead of using a level like the tutorial I''ve started with a cube using coordinates in the actual code like the before tutorials. My forward and turning movements seem to work fine, but when I use PageUP/DOWN to look up or down it don''t work right. I use variables and glRotatef just like when you turn (like in the tutorial), to start off it works ok, but if you walk around to the side of the cube and look up/down it rotates the wrong way.Anyone know what could be wrong or would have a quick look at the code, the code is simple and short like me =) Any help is great, thanks.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
This sounds like gimbal lock to me. That is what happens when you use those evil eulers. Do a web search for that to find out what it is, since I don''t got the time at the moment to explain.




Share this post


Link to post
Share on other sites
Thanks for the input mate, but I figured out what was wrong,.........AFTER AN HOUR OF STARING AT IT. It turns out that I was rotating the sideways panning before my vertical panning. I presume this matters because the vertical panning is dependant of the position of the sideways panning variables,...even though that makes no sense it is a lesson well learnt ! ! !

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!