Notifications
Clear all

[Closed] match 1 or 2 axes using quaternions

I sometimes need to match the rotation of objects along only 1 or 2 axes.
I usually do this by converting the object.rotation (quats) to euler angles,
matching the X Y and/Or Z components,
then either setting a euler controller or converting euler values back to quats.

I wonder if it is possible to match angles along only 1 or 2 axes with only quat values?

2 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

is this question about controllers or math calculations?

uhm…probably math?

what I am after is this:

with quaternions a 100% rotation match is easy:

obj_a.rotation=obj_b.rotation

but since a quat’s .x, .y, .z values are not angles,
matching less than 3 axes is more diffcult
this doesn’t work –at least not as needed:


obj_a.rotation.x=obj_b.rotation.x
obj_a.rotation.y=obj_b.rotation.y

yes obj_a’s rotation components take on obj_b’s, and obj_a rotates,
but the resulting X and Y euler rotation’s don’t match

I am guessing that converting to euler is the simplest approach.