Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a quaternion rotation?

Tags:

Is quaternion rotation just a vector with X,Y,Z which the object will rotate towards, and a roll which turns the object on its axis?

Is it that simple?

Meaning if you have X=0, Z=0 and Y=1 the object will face upwards?
And if you have Y=0, Z=0 and X=1 the object will face to the right?

(assuming X right, Y up and Z depth)

like image 441
Robin Rodricks Avatar asked Oct 26 '10 11:10

Robin Rodricks


People also ask

How do quaternions describe rotation?

Quaternions are an alternate way to describe orientation or rotations in 3D space using an ordered set of four numbers. They have the ability to uniquely describe any three-dimensional rotation about an arbitrary axis and do not suffer from gimbal lock.

What does a quaternion represent?

A quaternion represents two things. It has an x, y, and z component, which represents the axis about which a rotation will occur. It also has a w component, which represents the amount of rotation which will occur about this axis. In short, a vector, and a float.

How do you rotate an object with quaternion?

You can write this as (q, c, f); simply stated, "Transform a point by rotating it counterclockwise about the z axis by q degrees, followed by a rotation about the y axis by c degrees, followed by a rotation about the x axis by f degrees." There are 12 different conventions that you can use to represent rotations using ...

What does quaternion mean in unity?

Description. Quaternions are used to represent rotations. They are compact, don't suffer from gimbal lock and can easily be interpolated. Unity internally uses Quaternions to represent all rotations. They are based on complex numbers and are not easy to understand intuitively.


1 Answers

A quaternion has 4 components, which can be related to an angle θ and an axis vector n. The rotation will make the object rotate about the axis n by an angle θ.

For example, if we have an cube like

 ______ |\  6  \ | \_____\     z |5 |    | : y ^  \ | 4  |    \|   \|____|     +--> x 

Then a rotation of 90° about the axis (x=0, y=0, z=1) will rotate the "5" face from the left to the front.

 ______ |\  6  \ | \_____\      z |3 |    | :  x ^  \ | 5  |     \|   \|____|  y<--+ 

(Note: This is the axis/angle description of rotation, which is what OP confuses. For how quaternion is applied to rotation, see http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation)

like image 69
kennytm Avatar answered Oct 11 '22 12:10

kennytm