www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: idkm23 on December 28, 2015, 08:11:02 pm

Title: Rotating joints
Post by: idkm23 on December 28, 2015, 08:11:02 pm
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:

Code: [Select]
//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.
Title: Re: Rotating joints
Post by: raft on December 28, 2015, 09:01:06 pm
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 (http://www.okino.com/conv/skinning.htm)
Title: Re: Rotating joints
Post by: idkm23 on December 29, 2015, 12:54:58 am
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.
Title: Re: Rotating joints
Post by: raft on December 29, 2015, 01:47:43 am
Isn't there a simple solution to just rotating a bone on a joint?
SkeletonHelper (https://gist.github.com/Chase-san/5253808) may help.
Title: Re: Rotating joints
Post by: idkm23 on December 29, 2015, 09:30:42 pm
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.