开发者

Rotating in 3d space - random values of x,y,z rotation so end result = beginning

开发者 https://www.devze.com 2023-04-12 16:40 出处:网络
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

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:

Rotating in 3d space - random values of x,y,z rotation so end result = beginning


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号