- #1
atrus_ovis
- 101
- 0
How to find that? In R3.
I want to rotate everything around a vector, at an angle A. (making a n openGL game at my free time)
I tried , for normalized vector V = <x,y,z>:
Displace V to start of axes.
angleToYZ = acos(y);
Rotate all around Z with that angle. (1)
angleToZ = acos(z);
Rotate all around X with that angle. (2)
Now V is on the Z axis.
Rotate all around Z with angle A.
perform (2) , (1) with opposite respective angles.
Problem is, when i implement that for rotation around another vector, individually the rotations work, but when i.e. i do a rotation around V1, then the rotation around V2 gets messed up.
Is there a mathematical error in the above?
I want to rotate everything around a vector, at an angle A. (making a n openGL game at my free time)
I tried , for normalized vector V = <x,y,z>:
Displace V to start of axes.
angleToYZ = acos(y);
Rotate all around Z with that angle. (1)
angleToZ = acos(z);
Rotate all around X with that angle. (2)
Now V is on the Z axis.
Rotate all around Z with angle A.
perform (2) , (1) with opposite respective angles.
Problem is, when i implement that for rotation around another vector, individually the rotations work, but when i.e. i do a rotation around V1, then the rotation around V2 gets messed up.
Is there a mathematical error in the above?