rotate problem in 3d
in
Programming Questions
•
2 years ago
I have this sphere which represents a player, so atm you look at the back of it.
What i want is to control it with the mouse (atm i have sliders).
If i change the rotateX then it 'looks' up/down simulair to vertical mouse movement in a game.
If i change rotateY then it rotates to left/right, simulair to horizontal mouse movement.
Both things above are correct, if only one value is adjusted (or y or x), however in combination i get unwanted rotation.
it's like a dog doing this:
But i don't want that, in other words the rotation is world based.
How can i solve this problem?
What i want is to control it with the mouse (atm i have sliders).
If i change the rotateX then it 'looks' up/down simulair to vertical mouse movement in a game.
If i change rotateY then it rotates to left/right, simulair to horizontal mouse movement.
Both things above are correct, if only one value is adjusted (or y or x), however in combination i get unwanted rotation.
it's like a dog doing this:
But i don't want that, in other words the rotation is world based.
How can i solve this problem?
1