How To Use Quaternion Rotation In Blender
List pylist of int float a 3d or 4d list to initialize quaternion.
How to use quaternion rotation in blender. 1 in computers everything is represented by numbers. I am writing a blender exporter for my scene format. Don t be frightened by the length. I used the rotatex rotatey and rotatez functions to rotate a box in 3d. I ran into problems like gimbal lock when using this method.
When exporting i need the rotation as quaternion. Create a new quaternion object from initialized values. Quaternions are 3d rotations performed by the multiplication of quaternions. So for rotation quaternions q 1 q q 0 q 1 q 2 q 3. For those who are interested let s continue it here.
Numbers make up everything we do on computers including blender. Blender is the free open source 3d content creation suite available for all major operating systems. Here s the basics of quaternion rotations may not be entirely clear and it glosses over some stuff. Open blender delete the default cube add a monkey and switch the rotation mode to quaternion i know not much of a challenge yet for most of you but wait fill in the w x y z fields so that suzanne rotates 180 around the axis that goes through 0 0 0 and 3 4 5. Quat quaternion 1 2 3 4 quat quaternion axis angle quat quaternion quat quaternion 180 list parameters.
A proper explanation would involve much less talking and a couple. In my project i have used a complimentary filter to generate yaw roll and pitch angles. We provide daily news art and tutorials. 4d if intializing w x y z 3d if used as an axis of rotation. A bit of a discussion about quaternion rotations started on this thread but it was off topic.
Before explaining how these rotations work we ll need to define a few terms first. For rotation quaternions the inverse equals the conjugate. Follow blendernation twitter facebook google tumblr pinterest. 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. It s actually pretty simple.