Hi there,
I've just started to use bullet as my iPhone game's physics engine.. and its great!
While I was integrating between the game's engine and bullet, I've noticed that the object's orientation is done with quaternions.
My character's orientation is presented in two ways:
- Directional vector + Up vector.
- 4x4 Transformation matrix(just before passing it to OpenGL's pipeline).
I've seen a couple of ways transforming 4x4matrices to quats or up+forward+right vectors to quats..
The question is: do I really have to go through all those conversions?, or maybe that I've missed something in the way?
thanks,
Amir
Is there anyway around quaternions for setting orientation?
-
- Posts: 2
- Joined: Mon Nov 08, 2010 1:38 am
-
- Posts: 10
- Joined: Thu May 20, 2010 10:45 pm
Re: Is there anyway around quaternions for setting orientati
First ask yourself why you are inventing your own orientation representation (Directional vector + Up vector) rather than using an existing representation. There are many to choose from.
If you don't feel like learning quaternions, consider using a 3x3 matrix. Your representation is very much like a 3x3 matrix with an implicit 3rd basis vector, so the change should not be difficult. bullet will easily convert these to and from quaternions if necessary.
Also consider using quaternions. They are popular for many reasons.
If you don't feel like learning quaternions, consider using a 3x3 matrix. Your representation is very much like a 3x3 matrix with an implicit 3rd basis vector, so the change should not be difficult. bullet will easily convert these to and from quaternions if necessary.
Also consider using quaternions. They are popular for many reasons.
-
- Posts: 26
- Joined: Mon Jun 01, 2009 2:21 pm
- Location: Sweden
Re: Is there anyway around quaternions for setting orientati
If you use matrices for storing transformation you will need to continiously renormalize them to prevent drift.
Read section 4 of this paper for more information.
http://www.cs.cmu.edu/~baraff/pbm/rigid1.pdf
Read section 4 of this paper for more information.
http://www.cs.cmu.edu/~baraff/pbm/rigid1.pdf