Zeroing one component of a quaternion

Zeroing one component of a quaternion

Anonymous
Not applicable
317 Views
3 Replies
Message 1 of 4

Zeroing one component of a quaternion

Anonymous
Not applicable
I need to rotate an object by the difference of two quaternions, but I need to consider only the y and z components of this difference. How can I zero only the X component?
0 Likes
318 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
use slerp to interpolate between quats, then do a conversion to eulers, zero x then convert back to quats

You should read the mxs docs section on rotations. It may be confusing at first, but keep at it...it will sink in.
0 Likes
Message 3 of 4

Anonymous
Not applicable
use slerp to interpolate between quats, then do a conversion to eulers, zero x then convert back to quats

You should read the mxs docs section on rotations. It may be confusing at first, but keep at it...it will sink in.

Why the interpolation?
0 Likes
Message 4 of 4

Anonymous
Not applicable
sorry...you're right slerp isn't needed...coffee hasn't worked for me lately

(this assumes you have three point helpers named point01 - point03)

foo = ($point01.rotation - $point02.rotation)
foo_euler = foo as eulerangles
foo_euler_zero = (eulerAngles 0.0 foo_euler.y foo_euler.z)
rotate $point03 foo_euler_zero
0 Likes