[Closed] How do I get "clean" rotations?
Attached the file that I am having problems with.
What am I doing wrong with each of these?
fn getObjFrames &f t =
(
if isController t.controller do
(
join f (for k in t.controller.keys collect k.time.frame as integer)
f = sort (makeUniqueArray f)
for i = 1 to t.numSubs do getObjFrames &f t[i]
)
f
)
obj = $Bone_UpperArmL
theFrames = (f = #(); getObjFrames &f obj)
/*
--Solution 1 (converting to smooth rotation and back)
obj.controller.fk_sub_control.rotation.controller = bezier_Rotation() -- fixes the problem
obj.controller.fk_sub_control.rotation.controller = euler_XYZ() -- breaks it again
*/
/*
--Solution 2 (setting rotations as euler angles)
for f in theFrames do with animate on at time f
(
objPos = obj.pos
obj.rotation = obj.rotation as eulerAngles
obj.pos = objPos
)
*/
what is wrong with this animation? i don’t see any rotation problem.
ahh… i see. the UpperArm bone rotation doesn’t match IK handled bone (UpperArm AutoClav).
well that because FK bone rotation controller (Euler) does do interpolation separately for every channel.
IK bone rotation is solved by IK Solver and uses Quat interpolation. That’s why when you switch to Smooth rotation you see the matched result.
there is nothing that you can do with it.
So is there any way to get that result while using a euler_XYZ() controller?
no. or using c++ and sdk write your own IK solver that will interpolate using Eulers. but that’s probably is not a solution.
but why do you want to match them? i think that animators specially ask for FK and Eulers because they like to work with bezier curves in some situations.
Well yeah, I want the curves to be editable, that is why I want to use euler_XYZ instead of bezier_rotation. I just don’t understand why the default XYZ rotations take such an indirect path.
On another note, it interpolates much better when I use ZYX rotation, but as far as actually manipulating bones like that it seems to be impossible.
as i remember Leonhard Euler originaly used ZXZ rotation probably it’s a best match to quat interpolation.
ZXZ… how does… is that… what??
Okay, I don’t understand that in the slightest but it seems to be working so far. I will let you know how it turns out…
i’ve thought a little and there is some workaround.
you can make rotation list where first controller is Smooth, and second is Euler. if you need to align FK rotation to IK just set quat values to the first controller and ZERO to the second.
I’ll play around with both solutions and let you know my results.
EDIT: Actually, the ZXZ rotation is working so well right now that I’m going to put off messing around with the other suggestion until I have either the time or the need to do so.