How To Use Quaternion Rotation In Blender
Follow blendernation twitter facebook google tumblr pinterest.
How to use quaternion rotation in blender. We provide daily news art and tutorials. Now i m using a quaternion based complimentary filter to generate quaternions that represent the orientation of the box. 1 in computers everything is represented by numbers. I am writing a blender exporter for my scene format. Before explaining how these rotations work we ll need to define a few terms first.
My temporary solution current looks like. A bit of a discussion about quaternion rotations started on this thread but it was off topic. Don t be frightened by the length. List pylist of int float a 3d or 4d list to initialize quaternion. For those who are interested let s continue it here.
Inverting or conjugating a rotation quaternion has the effect of reversing the axis of rotation which modifies it to rotate in the opposite direction from the original. Here s the basics of quaternion rotations may not be entirely clear and it glosses over some stuff. Create a new quaternion object from initialized values. Quat quaternion 1 2 3 4 quat quaternion axis angle quat quaternion quat quaternion 180 list parameters. I used the rotatex rotatey and rotatez functions to rotate a box in 3d.
So for rotation quaternions q 1 q q 0 q 1 q 2 q 3. Numbers make up everything we do on computers including blender. In my project i have used a complimentary filter to generate yaw roll and pitch angles. It s actually pretty simple. A proper explanation would involve much less talking and a couple.
For rotation quaternions the inverse equals the conjugate. Quaternions are 3d rotations performed by the multiplication of quaternions. I ran into problems like gimbal lock when using this method. When exporting i need the rotation as quaternion. 4d if intializing w x y z 3d if used as an axis of rotation.