开发者

How do I modify a quaternion such that the Euler rotation on one axis is zero?

I've got two nodes, and I know the rotation of only one of them.

I want to apply the rotation of node 1 to nod开发者_如何学Ce 2, but with one axis zeroed out (in Euler terms).

How?


Never mind, I figured it out.

e.g. For x axis:

double xRot = -(myQuat.ToEuler().x)
Quat qDiff = Quat(sin(xRot / 2.0), 0, 0, cos(xRot / 2.0)).Normalize()
Quat myQuatZeroX = myQuat * qDiff
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜