How To Use Quaternion Rotation In Blender

A proper explanation would involve much less talking and a couple.
How to use quaternion rotation in blender. The easiest way i found is to use the rotation quaternion but this member only guarantees to store the rotation when the rotation mode is set to quaternion. List pylist of int float a 3d or 4d list to initialize quaternion. Follow blendernation twitter facebook google tumblr pinterest. My temporary solution current looks like. Don t be frightened by the length.
Before explaining how these rotations work we ll need to define a few terms first. 1 in computers everything is represented by numbers. Here s the basics of quaternion rotations may not be entirely clear and it glosses over some stuff. 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. I am writing a blender exporter for my scene format.
For those who are interested let s continue it here. 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. 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. Blender is the free open source 3d content creation suite available for all major operating systems.
For rotation quaternions the inverse equals the conjugate. Create a new quaternion object from initialized values. 4d if intializing w x y z 3d if used as an axis of rotation. Numbers make up everything we do on computers including blender. Quat quaternion 1 2 3 4 quat quaternion axis angle quat quaternion quat quaternion 180 list parameters.
I ran into problems like gimbal lock when using this method. In my project i have used a complimentary filter to generate yaw roll and pitch angles. It s actually pretty simple. A bit of a discussion about quaternion rotations started on this thread but it was off topic. Quaternions are 3d rotations performed by the multiplication of quaternions.