loading...

WebGL2 : 135 : Quaternion Inverse Direction

sketchpunk profile image SketchPunk ・1 min read

This is the first video in relation to building IK Rigs Animation System. Before dealing with IK stuff, I want to go through a few math ideas that I found to be important when trying to animate characters with IK. The first one i'm calling "Quaternion Inverse Direction", because I have no better name for it since I noticed this after a few failed attempts of IK animation. The main idea is to try to create a universal direction no matter what rotational orientation all your objects exist in.

[Video Tutorial]

[Github]
https://github.com/sketchpunk/FunWithWebGL2/tree/master/lesson_135_quaternion_inverse_direction

Discussion

markdown guide
 

Thanks for sharing this! I really appreciate the github to see how this works.

I wonder if there are other techniques this is used for other than animation, such as a game where the character is on a rail shooter but they can still turn while making forward progression.

 

I wouldn't know about this technique to be honest. I stumbled onto it after many failed attempts of trying to translate animation from one skeleton to another.

 

So if I'm understanding this correctly, this technique guarantees a consistent forward direction regardless of the tilt or orientation of the object?

 

It locks forward or any direction to whatever tilt or orientation of the object. I use this for 3D armature animation since the bone structures are different plus their bind pose. By setting the armatures to a tpose, then compute the same direction on the different bones, I create a way to have a universe direction on specific parts of the body independent of the actual orientation.