Hi all, and merry christmas.
I've a problem in one of my spare time projects that has been bugging me for quite a while. I'm playing with an IK implementation and my bones simply won't do what i want.
My plan is to modify the Quaternion.lookAt() method:
public void lookAt(Vector3f direction, Vector3f up ) {
tmpZaxis.set( direction ).normalizeLocal();
tmpXaxis.set( up ).crossLocal( direction ).normalizeLocal();
tmpYaxis.set( direction ).crossLocal( tmpXaxis ).normalizeLocal();
fromAxes( tmpXaxis, tmpYaxis, tmpZaxis );
}
I use a rig from blender, which has Y going along the length of the bone. I think i've now tried every combination of axis changing/flipping, but the bones never point where they're supposed to, and i must now admit that my grasp of quaternions is rather weak. It seems it shouldn't be that hard for someone with better understanding of math.
To summarize what i want help with:
I'd like to have the bone point towards "direction", but along the Y axis, rather than Z.
Thanks!