fallingbrickwork
02-13-2002, 10:50 AM
Hi all,
I'm having trouble rotating a sphere using the keys!!!
My problem is this:
When you press the `Rotate Right` Key the sphere rotate right (Y-Axis) which is correct.
When you press the `Rotate Up` Key the sphere rotate upwards (X-Axis) which is correct.
But,
If the sphere has rotate through 180 degrees upwards or downwards, the `Rotate Right` Key rotates Left. This is due to the Axis being flipped. How can I get around this?? I'm writing a very basic `Top View (Looking down)` move the ball through the maze type game.
I want the ball to always rotate in the direction of the key press.
I've heared something about `quaternion` <-spelling???? and 'gimble lock',is this the answer!? I fear these are abit over my head!!!! Is it possible to fix my problem cleverly using glRotate ?? Matrices ?? As a newbie, I'm not really sure about matrices, so please help !! Do you know of any example source showing something similar???
Many thanks in advance.
I'm having trouble rotating a sphere using the keys!!!
My problem is this:
When you press the `Rotate Right` Key the sphere rotate right (Y-Axis) which is correct.
When you press the `Rotate Up` Key the sphere rotate upwards (X-Axis) which is correct.
But,
If the sphere has rotate through 180 degrees upwards or downwards, the `Rotate Right` Key rotates Left. This is due to the Axis being flipped. How can I get around this?? I'm writing a very basic `Top View (Looking down)` move the ball through the maze type game.
I want the ball to always rotate in the direction of the key press.
I've heared something about `quaternion` <-spelling???? and 'gimble lock',is this the answer!? I fear these are abit over my head!!!! Is it possible to fix my problem cleverly using glRotate ?? Matrices ?? As a newbie, I'm not really sure about matrices, so please help !! Do you know of any example source showing something similar???
Many thanks in advance.