Computer Graphics

Euler Angles to Quaternion transformation and back (independent of rotation order)

Here is a bit of matlab code to illustrate how you can convert Euler angles to a Quaternion. The function outputs resulting rotation in Axis Angle form and also prints Euler Angles (transformed from Quaternion) just to show that transformation is correct.

If you are interested in how to transform Quaternion to Euler Angles, have a look at functions to_euler and get_p.

Quick guide to Quaternions

Introduction

Quaternions are an alternative way of specifying rotations. They do not store redundant information like Euler Angles do, and they require less multiplication operations to combine rotations than rotation matrices. It is also extremely easy to interpolate between two quaternions. Information on quaternions is widely available on the net in different shapes and forms. During my assignment I spent a lot of time researching quaternions and found useful bits and pieces scattered across the web. This guide is an attempt to compile all the material I use now for future reference. Maybe someone will find this useful aswell? Who knows? :)

Syndicate content