🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Rotation
With glRotate(90, 0.0, 0.1, 0.0) a cube (for example) is rotated with 90 degrees around oy. But this coordinate system is linked to the cube; it rotates itself together with the cube. I want to use another coordinate system: as I sit down on the chair in front of my computer and I look to the screen, OX is a horizontal line on the screen and OY is a vertical line on the screen. The cross point between them is at the left-down corner of the monitor.
If the cube is in a random position (ox, oy and oz have a random orientation), how do I rotate it around OX? What about OY?
Another question: how do I modify the speed of rotation?
And my last question so far: how do I catch with GLUT that event when all 3 mouse buttons are pressed simultaneously?
Thanks!
If you use glRotatef(angle,1.0,0.0,0.0);
you actually rotate the whole cordinate system not a cube.
And you can change the cordinates to the way you want them in a way with glOrtho(somestuff) but I don''t recomend it!
So how should you rotate your object which is at a random
distance?
well you could translatef it to the center and then rotate it and then put it back!
well the speed is depent of how many degress you rotate /frame!
ohh well what the heck lets try it?
you actually rotate the whole cordinate system not a cube.
And you can change the cordinates to the way you want them in a way with glOrtho(somestuff) but I don''t recomend it!
So how should you rotate your object which is at a random
distance?
well you could translatef it to the center and then rotate it and then put it back!
well the speed is depent of how many degress you rotate /frame!
ohh well what the heck lets try it?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement