Sign in to follow this  
eem

Pole Vector Constraint? Or rotate plane.

Recommended Posts

eem    100
I am trying to make an inverse kinematic solution. I have it mostly figured out, but I need can't figure out how to get control over the direction knee aims. I am trying to make a pole vector. Basically this means I need to get a joint to aim at one target using the X and Z axis, then aim at another target using the Y axis. How would you do this? I made this diagram to help illustrate http://omploader.org/vM2wwMg/poleVector.jpg

Share this post


Link to post
Share on other sites
haegarr    7372
Do we speak about a selfmade implementation of a mathematical approach? Then perhaps the following may help:
The length of the vector from the hip to the knee is
x2 + y2 + z2 = L2
where y can be computed from pointing to the 2nd target, so that unknown and known parts separated looks like
x2 + z2 = L2 - y2

Both the vector we're looking for as well as the vector to the 1st target should be co-linear if projected onto the plane, so that
x = k * x' and z = k * z'
where x', z' are the said (projected) co-ordinates of the 1st target's vector. This simple formulation works so only if the rotation plane is parallel to the local space's x/z plane, of course. Otherwiese you actually need some transformation to get that right.

Then
k2 * ( x'2 + z'2 ) = L2 - y2
resp.
k = +/- sqrt( ( L2 - y2 ) / ( x'2 + z'2 ) )
from what the negative result can be ignored because it would lead in the opposite direction of what we want.

Hence ( k * x', y, k * z') would be result if I made no mistake.


Or do we speak about Maya? Then perhaps this thread in CGSociety or something similar may be of interest.

Share this post


Link to post
Share on other sites
eem    100
Ya I wanted to know the actual math behind it, thank you I will try to get that work

Now that math is done in matrix multiplication, correct?

z = k * z'

k and z are matrices? and z' means the inverse?

Share this post


Link to post
Share on other sites
haegarr    7372
Quote:
Original post by eem
Ya I wanted to know the actual math behind it, thank you I will try to get that work

Now that math is done in matrix multiplication, correct?

z = k * z'

k and z are matrices? and z' means the inverse?

Nope; all these are scalars: z is the 3rd component of the vector hip-to-knee, z' is the 3rd component of the vector pointing to the 1st target point, and k is a scalar constant that is computed as shown in my previous post.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this