Rotating in 3d space - random values of x,y,z rotation so end result = beginning
Can anyone tell me the formula for determining what combinatio开发者_如何转开发n of x,y,z rotation values will give the same result as a normalized object(no rotation) in 3d space?
If you know both the end result and the initial state, then it's just basic matrix multiplication. You'd have to find the angles used to rotate the object (one for the x-axis, y-axis and z-axis) and left-multiply your coordinate vectors by this guy:
Choosing uniformly distributed random angles [-pi, pi] will not lead to a uniformly random rotation axis on the sphere! Wikipedia has a nice explanation about this phenomenon, which is called the "gimbal lock". See "Fast Random Rotation Matrices" by James Arvo for one algorithm that produces uniformly random rotations.
精彩评论