Jump to content

  • Log In with Google      Sign In   
  • Create Account

Quaternions: Can you multiply it with vertices, so that the vertices can be affine transformed (rotated on a non-origin point) by an arbitrary axis?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 tom_mai78101   Members   -  Reputation: 577

Like
0Likes
Like

Posted 07 October 2013 - 05:13 AM

I'm starting to learn more about quaternions and its geometric meaning in the world of computer graphics.

 

From reading a borrowed book late in the night, I recall that one of its geometric meaning is that it can rotate a model once by an arbitrary axis spherically.

 

Can it allow affine transformation, so that a vertex Vn in an object space be rotated by a point (x + O1, y + O2, z + O3), where (O1, O2, O3) is the object space origin, and Vn is one of the vertices in a vertex buffer object?

 

Unless I have to re-borrow the book again...

 



Sponsor:

#2 haegarr   Crossbones+   -  Reputation: 4588

Like
0Likes
Like

Posted 07 October 2013 - 05:31 AM


Can it allow affine transformation, so that a vertex Vn in an object space be rotated by a point (x + O1, y + O2, z + O3), where (O1, O2, O3) is the object space origin, and Vn is one of the vertices in a vertex buffer object?

With quaternions rotation and scaling (and hence mirroring) can be expressed, but not translation (AFAIK). The usual case is rotation what requires the quaternion to be of unit length.

 

It is possible to rotate a position vector, as is described e.g. here. As with other rotation representations, the axis' of rotation direction is encoded in the rotation, but passes through the current (0,0,0) and hence may need to be translated explicitly if required.



#3 Álvaro   Crossbones+   -  Reputation: 13912

Like
0Likes
Like

Posted 07 October 2013 - 08:14 AM

As haegarr said, a unit quaternion represents a rotation in the vector space R^3, but it cannot represent a translation. You can represent a "movement" (which I define as an affine transformation that preserves distances and orientation) as the composition of a translation and a rotation, and the quaternion is a fine way to encode the rotation.



#4 Khatharr   Crossbones+   -  Reputation: 3040

Like
0Likes
Like

Posted 07 October 2013 - 10:04 PM

Looks like you got your answer. Just as an aside, I think it's safe to step up from the beginners section with questions like this, lol.


void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

#5 tom_mai78101   Members   -  Reputation: 577

Like
1Likes
Like

Posted 08 October 2013 - 05:19 AM

Thanks, everyone. And yeah, guess I can step it up.

#6 Paradigm Shifter   Crossbones+   -  Reputation: 5436

Like
0Likes
Like

Posted 08 October 2013 - 06:03 AM

Maths and physics is the quaternion questions forum.

 

The point transform operation pointout = q * pointin * q-1 (where the point is pure imaginary i.e. the w component is 0) maps the origin to the origin so to rotate around a point you need to translate the object so its centre of rotation is at the origin, rotate the object and rotate the translation you applied, then apply the negated rotated translation to the object again.

 

Matrix multiplication also maps the origin to the origin, but in homogeneous coordinates the origin is actually (0, 0, 0, 1) and translation is possible. (Note the "real" origin (0, 0, 0, 0) isn't a valid element of homogeneous space and is indeed mapped to (0, 0, 0, 0) by multiplication by any 4x4 matrix).

 

EDIT: That is because matrix multiplication is a linear mapping, i.e.

 

f(k * a) = k * f(a)

 

and f(a + b) = f(a) + f(b)

 

from which we see f(0) = f(0 * a) = 0 * f(a) = 0. (Alternatively, f(0) = f(a + (-a)) = f(a) + f(-a) = f(a) - f(a) = 0)


Edited by Paradigm Shifter, 08 October 2013 - 06:12 AM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS