Re: Quaternion Camera
- From: fungus <umailMY@xxxxxxxxxxxxxxx>
- Date: Tue, 02 Aug 2005 15:25:18 +0200
Tony O'Bryan wrote:
It's not very hard once it's laid out in layman's terms. I'm not a math type by any means, so you can rest assured that matrices for basic 3D manipulations with OpenGL are not that tough.
The best thing about matrices is that they do *everything*.
Quaternions don't. A quaternion is only a rotation, nothing more. For real life usage you also need a translation and often a scale factor as well. By the time you've bolted all this together then your quaternions aren't going to be looking so neat and tidy any more.
For example, how do I move "forwards" in a quaternion representation? With a matrix it's easy - the second (or third) row of the matrix is your "forward" vector. Just multiply it by your speed and add it to the position (bottom row of the matrix). A quaternion is a lot more complex, and that's what Dave's paper which "proves" that quaternions are faster fails to take into account, - ie. that real life is more than just joining rotations together.
I suggest a Matrix class which has an extra flag to tell you the contents:
"ROTATION" - only the top 3x3 is useful "RIGID" - a rotation and a translation "AFFINE" - rotation, translation and scale. "GENERAL" - all 4x4 entries are used (eg. for Beziers)
Your matrix multiply can now look at the two matrices and optimize accordingly (you know where the ones and zeros are).
Matrix inversions can also be very much faster with this scheme (eg. the inverse of a rotation is just the transpose...etc).
I'm betting that such a matrix scheme is faster than quaternions in real life and just as powerful.
-- <\___/> / O O \ \_____/ FTB. For email, remove my socks.
In science it often happens that scientists say, 'You know that's a really good argument; my position is mistaken,' and then they actually change their minds and you never hear that old view from them again. They really do it. It doesn't happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion.
- Carl Sagan, 1987 CSICOP keynote address
.
- References:
- Quaternion Camera
- From: Andreas Volz
- Re: Quaternion Camera
- From: Andreas Volz
- Re: Quaternion Camera
- From: Tony O'Bryan
- Quaternion Camera
- Prev by Date: Re: Pixel exact rasterization of lines
- Next by Date: Re: Pixel exact rasterization of lines
- Previous by thread: Re: Quaternion Camera
- Next by thread: A good source for vertex array information.
- Index(es):
Relevant Pages
|
Loading