dflemstr
It's a ball.
So, basically I'm making a game that relies heavily on a 3D physics engine (Bullet, in this case).
Let's not discuss wether or not it will be possible to use Bullet on the Pandora, I'm currently getting 2000 FPS on my main machine so it shouldn't be a problem I hope
The problem is the following:
- I use OpenGL for drawing.
- My 'Drawable' class (it's not really called Drawable but instead split up into 8 different classes, I'm simplifying things here) stores it's rotation in a 3D Vector (Vector3f), where each element of the vector represents one axis rotation (so vector.x represents the rotation around the x-axis, etc). This is to enable graphics engine backend modularity; I don't want to use something too engine-specific for the rotation.
- The 'Drawable' class is linked to a RigidBody in Bullet, so when the bullet body moves, the Drawable moves.
- Bullet uses pure matrices internally for dynamics + transformations, but spits out a quarternion (Quat4f) when I ask for the rotation of a physics object.
Now, I need to convert this quaternion into a more 'normal' vector for rotation transformation. How would I go about doing this? I've never worked with quaternions before so I have absolutely no idea on how to handle them.
Any help would be greatly appreciated!
Let's not discuss wether or not it will be possible to use Bullet on the Pandora, I'm currently getting 2000 FPS on my main machine so it shouldn't be a problem I hope
The problem is the following:
- I use OpenGL for drawing.
- My 'Drawable' class (it's not really called Drawable but instead split up into 8 different classes, I'm simplifying things here) stores it's rotation in a 3D Vector (Vector3f), where each element of the vector represents one axis rotation (so vector.x represents the rotation around the x-axis, etc). This is to enable graphics engine backend modularity; I don't want to use something too engine-specific for the rotation.
- The 'Drawable' class is linked to a RigidBody in Bullet, so when the bullet body moves, the Drawable moves.
- Bullet uses pure matrices internally for dynamics + transformations, but spits out a quarternion (Quat4f) when I ask for the rotation of a physics object.
Now, I need to convert this quaternion into a more 'normal' vector for rotation transformation. How would I go about doing this? I've never worked with quaternions before so I have absolutely no idea on how to handle them.
Any help would be greatly appreciated!
Last edited by a moderator: