Advertisement

Quaterions?

Started by October 18, 2001 01:53 AM
0 comments, last by Jankey 23 years, 3 months ago
ämm ... yes, i know what quaterions are, i have seen a lot of Calculation Codes for them, the forumular they work is x² + Y² + z² + w² = 1 a friend said that i can use them as a Vector, but what happens if X = 0 , Y = 0 , Z = 0 , and W = 1 ??? ... could somebody explain this ( and please dont give me always links ! ) And how could i usw them, if i want to rotate about an axis .. ? Can i use them to Vector Calculations ... an how ?
J.A.N.K.E.Y.: Journeying Artificial Nocturnal Killing and Exploration Youth
> the forumular they work is x² + Y² + z² + w² = 1

This is the condition for a quaternion to be a unit quaternion. It''s usual to impose this condition on quaternions you want to use for rotations - you can do rotations with non-unit quaternions but it''s more work.

> a friend said that i can use them as a Vector,

Vectors and quaternions are different things, although they look similar. Quaternions and rotation matrices are related, as they do the same thing [rotate] and it''s possible to convert betwwen them.

> but what happens if X = 0 , Y = 0 , Z = 0 , and W = 1 ??? ...
> could somebody explain this ( and please dont give me always
> links ! )

This is an identity quaternion. Like an identity matrix it is equivalent to a rotation that does not change anything.

> And how could i usw them, if i want to rotate about an
> axis .. ?

Look for code to convert from angle-axis to quaternion. E.g. there''s lots of info on this in gamedev''s articles. Often there''s a library call that does this, e.g. there''s one in D3D.

> Can i use them to Vector Calculations ... an how ?

You can use quaternions to rotate vectors. Again look for sample code to do this or use library functions.
John BlackburneProgrammer, The Pitbull Syndicate

This topic is closed to new replies.

Advertisement