## [Algorithms] Quaternions or Matrices

 [Algorithms] Quaternions or Matrices From: Stefan Maton - 2003-02-28 07:21:13 ```Hi, I've been working with quaternions for quite some time now and have been using them within my engine for more than 1 1/2 years. I wonder why quaternions are not used on a broad manner. Looking at the main functions : Matrix(4x4) Multiply : 64 float mults and 64 float add Quaternion Multiply : 16 float mults and 12 float add Matrix(4x4) Add : 16 float adds Quaternion Add : 4 float adds Additionally you only pass 10 floats (Quat, pos, scale) instead of 16 when passing it through a hierarchy to be transformed. Am I missing something ? What does people make use matrices instead of quaternions ? Kind regards, Stefan ```

 [Algorithms] Quaternions or Matrices From: Stefan Maton - 2003-02-28 07:21:13 ```Hi, I've been working with quaternions for quite some time now and have been using them within my engine for more than 1 1/2 years. I wonder why quaternions are not used on a broad manner. Looking at the main functions : Matrix(4x4) Multiply : 64 float mults and 64 float add Quaternion Multiply : 16 float mults and 12 float add Matrix(4x4) Add : 16 float adds Quaternion Add : 4 float adds Additionally you only pass 10 floats (Quat, pos, scale) instead of 16 when passing it through a hierarchy to be transformed. Am I missing something ? What does people make use matrices instead of quaternions ? Kind regards, Stefan ```
 Re: [Algorithms] Quaternions or Matrices From: Nick Newson - 2003-02-28 09:23:37 ```Hardware friendly. The kind of figures you're coming out with are not really relavent because the hardware is optimised for matrices. SIMD support means this drastically reduced. On PS2 for example, you can rotate a vector with a matrix with 8 VU instructions. In all fixed vertex pipeline API that I know about you have to supply your transform in matrices - so it makes sense to use them when you can. Nick. On Fri, 28 Feb 2003, Stefan Maton wrote: > Hi, > > I've been working with quaternions for quite some time > now and have been using them within my engine for more > than 1 1/2 years. > > I wonder why quaternions are not used on a broad manner. > > Looking at the main functions : > > Matrix(4x4) Multiply : 64 float mults and 64 float add > Quaternion Multiply : 16 float mults and 12 float add > > Matrix(4x4) Add : 16 float adds > Quaternion Add : 4 float adds > > Additionally you only pass 10 floats (Quat, pos, scale) > instead of 16 when passing it through a hierarchy to be > transformed. > > Am I missing something ? > > What does people make use matrices instead of quaternions ? > > Kind regards, > Stefan > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > ```
 Re: [Algorithms] Quaternions or Matrices From: Paul Firth - 2003-02-28 10:22:56 ```> drastically reduced. On PS2 for example, you can rotate a vector with a > matrix with 8 VU instructions. Erm, 4 you mean? ;-) Cheers, Paul. ```
 Re: [Algorithms] Quaternions or Matrices From: Nick Newson - 2003-02-28 11:25:17 ```Yeap...and 4 vector register loads. On Fri, 28 Feb 2003, Paul Firth wrote: > > drastically reduced. On PS2 for example, you can rotate a vector with a > > matrix with 8 VU instructions. > > Erm, 4 you mean? ;-) > > Cheers, Paul. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > ```
 RE: [Algorithms] Quaternions or Matrices From: Stefan Maton - 2003-02-28 10:33:50 ```> Hardware friendly. > The kind of figures you're coming out with are not really relavent because > the hardware is optimised for matrices. SIMD support means this > drastically reduced. On PS2 for example, you can rotate a vector with a > matrix with 8 VU instructions. Ok... that's a point. > In all fixed vertex pipeline API that I know about you have to supply your > transform in matrices - so it makes sense to use them when you can. This doesn't mean that you cannot use Quaternion meanwhile. In my other post, I sent some numbers about the number of add/mults you have in both ways. Kind regards, Stefan ```