z-axis rotation problem with 3D world
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.
February 13, 2001 11:10 AM
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.
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 ! ! !
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement