25
\$\begingroup\$

When I visualise a three dimensional rotation matrix, or scaling matrix I visualize it as three axes.

Is there a similar way that I can visualize a rotation quaternion?

\$\endgroup\$
1
  • \$\begingroup\$ It isn't really a visualization, but someone once put it to me as "complex numbers : 2 :: quaternions : 4" \$\endgroup\$
    – coderanger
    Oct 26, 2010 at 6:43

6 Answers 6

20
\$\begingroup\$

There is an entire 600 page book on "Visualizing Quaternions": http://books.google.ca/books?id=CoUB09xzme4C&lpg=PP1&ots=uEdJHsni9y&dq=Visualizing%20Quaternions&pg=PP1#v=onepage&q&f=false

The book is actually quite good, covering a wide range of topics. It starts with a good introduction to game related linear algebra, it talks about matrices and vectors, their shortcomings and why you would want to use Quaternions. It then explains what they are and how to make use of them. If you are interested you might want to pick it up: http://www.amazon.com/Visualizing-Quaternions-Kaufmann-Interactive-Technology/dp/0120884003

\$\endgroup\$
2
  • 1
    \$\begingroup\$ +1 for "Visualizing Quaternions", its a great book, have it too, highly recommended \$\endgroup\$ Sep 20, 2011 at 10:09
  • 8
    \$\begingroup\$ While a nice book, if that link ever goes bad, this answer will be completely useless. I suggest you provide some information in your answer about how to visualize quaternions as well. \$\endgroup\$
    – House
    Feb 21, 2015 at 15:59
12
\$\begingroup\$

One of the visualization methods I like is to represent quaternion (orientation in 3d space) as vector (x,y,z components) + spin (the rotation around that vector, stored in w component).

If you are looking for some online visualizer for quaternions, you can always use wolframalpha:

http://www.wolframalpha.com/input/?i=quaternion%3A+0%2B2i-j-3k&lk=3

Take the a look at the visualization labeled as "corresponding 3d rotation" (the 3d vector + spin):

enter image description here

I've found it useful while working with quaternions in my 3d engine.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Spot-on answer! This way, people can also understand the SLERP mechanism because they can picture quaternions on a 3D sphere, while the spin can be seen as the scalar rotation motion by that vector (guess it's something similar to what some mathematicians call a rotor -> geometricalgebra.net/quaternions.html ). \$\endgroup\$
    – teodron
    Feb 21, 2015 at 11:16
7
\$\begingroup\$

I visualize my quaternions as three-dimensional vectors (direction + length) with a bit to the side to be able to show rotation along the vector's axis.

It's a common way to visualize rotation vector in physics, but the name escapes me.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Angle-axis rotation? \$\endgroup\$ Oct 25, 2010 at 7:14
4
\$\begingroup\$

You do not necessarily need an alternate visualization technique for quaternions versus matrices.

When you visualize your rotation matrix as the 3 axes gizmo, what you're really visualizing is an orientation. Since the quaternion also represents an orientation, consider continuing to use your 3 axes gizmo as your mind's eye visualization object.

Rarely, for both quaternions or matrices, do you need to relate the actual component values into your visualization, so just because the component values of the quaternion do not relate to your 3 axes gizmo doesn't mean it can't be used for visualization purposes.

\$\endgroup\$
2
\$\begingroup\$

You can, but it becomes difficult. Instead of three separate axis of rotation, or three gimbals that are each moving independently one at a time, you have to picture a quaternion as a description of the full three dimensional rotation angle and the magnitude at once as a single description of the entire translation.

http://en.wikipedia.org/wiki/Quaternion_rotation

Quaternions are definitely not an area I'm rock solid on, but that wiki page has some decent info on it. Wikipedia talks about rotations on a hypersphere though, gets a little confusing. Good luck!

\$\endgroup\$
2
\$\begingroup\$

As you know, Quaternion is based on complex numbers and represents rotation of 4D sphere in 4D dimension. So you cannot visualize it 'as is'. I see that you know it too. And one and only one choice will be visualization of result of rotation. For example result of rotation of basis; Or you can render 3D sphere and paint it by layered 'temperature' of rotation by each axis; Good luck!

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .