May 10, 2020

###### Recent Posts

Planar Projection Onto A Sphere (Improved Eyelid Deformations)

December 15, 2018

1/7

# Up Vector Trick

February 14, 2018

For aim constraints, motion paths, and a few other nodes you need to use vectors or matrices to define the second axis of orientation for an object.

However you might have noticed that rotate plane ikHandles can't use matrices, they only take vector inputs, now you could go through a couple steps to get the y-axis vector for an object by giving it a child whose translate attributes are (0,1,0) and then subtracting parent's worldspace position from the child's worldspace position. But there's a much easier way.

All we need to do is use a vector product node set to "Vector Matrix Prodcut" to multiply the World Matrix of the object whose axis we wan't to turn into a vector, by the vector we want to extract. In this case I want to extract the x-axis of the joint so I set input1 to (1,0,0). Below you can see the results in action.

Something I didn't mention in the video is that you don't have you only use the x, y, or z axis vectors. You can use any vector, it's just easier to visualize with simple vectors.

Now I'm showing this off in a very specific context, but it's a pretty robust technique. With some creative thinking being able to extract the orientation vectors of an object cold be a very helpful. For example one of the features of Eyad Husseins's ICE autorigger is the ability to use arrow controls on the knees to aim the IK knees. Though I can't be sure how he did it, this technique can get you the same result.

You could even get away with not using a transform node for the matrix, and instead using a compose matrix node, if your need permit it.

This might even be a way to get rid of some of the "hacky" parts of my rigs that use slightly offset locators to drive one ikHandle with another. I will test this out and make a post if anything comes of it.