Notifications
Clear all

[Closed] problem with quaternions in rotationscript

Hi!

i try to script a rotationcontroller that adds some rotation to a given, animated euler XYZ rotation. For this i have a roatation list with the eulerXYZ in the first slot and a rotation script in the secound slot.
What i don’t really understand is, how these two gets combined. Actually i thought, that my quaternion in the rotation script will be processed in world coordsystem and add rotation to the quaternion which is generated by the eulerXYZ controller in the first slot.
But somehow i don’t get the results i’m expecting.

Can someone explain me how it’s actually working?

Thanks!

2 Replies
 PEN

I guess it would be best if we knew what was going wrong and what you expected to have happen.

List controllers to add up all the controllers in the list to get the final result but in the case of quat values I would guess that they are muliplied. The transform values of an object are calcualted in parent space, if you add a list controller then the first controller is in the parent space of the object that the list is on. The second controller is additive to the first.

Yes that’s it. The secound controller uses the local coordinate system of the object which results from the first controllers transformation.
I converted my global rotation vector to the local system of the object with:
myrotvec = myrotvec * (myobject.rotation.controller[1].rotation as matrix3)

and now everything works fine!

Thanks!