Is there anyway around quaternions for setting orientation?

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
MiNiZeRo
Posts: 2
Joined: Mon Nov 08, 2010 1:38 am

Is there anyway around quaternions for setting orientation?

Post by MiNiZeRo »

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
paul.dubois
Posts: 10
Joined: Thu May 20, 2010 10:45 pm

Re: Is there anyway around quaternions for setting orientati

Post by paul.dubois »

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.
Johan Gidlund
Posts: 26
Joined: Mon Jun 01, 2009 2:21 pm
Location: Sweden
Contact:

Re: Is there anyway around quaternions for setting orientati

Post by Johan Gidlund »

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
Post Reply