Pole Vector Constraint? Or rotate plane.
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
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.
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.
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?
Now that math is done in matrix multiplication, correct?
z = k * z'
k and z are matrices? and z' means the inverse?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement