So im building a plugin in Nuke (from The Foundry) that will mimic Maya's animation constraint behaviours. I have a parent, a child, and then options for point, orientation, aim, parent constraints. This is all working pretty well, however my biggest issue at the moment is the Aim constraint.
Some background: Working with the Nuke Matrix4 class Its worth noting this matrix is a 4x4 in which the first 3 columns of the first 3 rows apply to rotations/scale, and the last column of the first 3 rows is translation (X,Y,Z)
in Vector3 classes I am getting the source and target position. Target-source = ST Then im setting up a Y plane (one inverted, one not) Then i get the corss product of my ST point and the Y plane, and then another cross product of my ST and inverted Y plane. (for when the parent is behind the child to invert it) I then get the cross product of my ST and the result of my ST.cross(y_plane)
The aim constraint actually works quite well, but i get a lot of Z rotation in my camera (child) when the parent is in certain postions. I want to be able to avoid this Z rotation. Would anyone happen to know how to do so?