Rotating joints

Started by idkm23, December 28, 2015, 08:11:02 PM

Previous topic - Next topic

idkm23

I am currently working with ProceduralAnimationSample and I am trying to get our beloved seymour to wave at me. I am having trouble getting his palm to face me. I have the arm waving at me with his palm facing the void adjacent to him with the code below:

//elbow oscillatory motion
targetJoint(currentPose, 11, new SimpleVector(-1, 0, 0), new SimpleVector(-1 + Math.cos(seconds) * 5, -20, 0), 1.0f);


When I attempt to use the same method targetJoint for the wrist, I can get his fingers to point at me, but it does not rotate. I think I might need to do something to currentPose, but I am not sure.

Thanks for any insight.

raft

no, the code actually updates the relevant joint in SkeletonPose.

it's just that, the math behind the skeletal animation is a bit weird. to tell the truth I'm not fluent at that too. google and read for it. one thing you must remember is that, every joint's transformation is in its parent joint's space.

this may be a good starting point to read

idkm23

Isn't there a simple solution to just rotating a bone on a joint? I feel like the targetJoint function could rotate a bone if I changed the jointBindPose. I will keep looking into this. Thank you for your advice.

raft

Quote from: idkm23 on December 29, 2015, 12:54:58 AM
Isn't there a simple solution to just rotating a bone on a joint?
SkeletonHelper may help.

idkm23

I figured out that all you have to do is grab the matrix of the joint and use the function rotateX (or some other axis) and that seems to do the trick.