Hi,

On Tue, 2004-10-05 at 23:22, Andreas Langs wrote:
> Hi, 
> 
> this time I solved or better got arround the following Problem, which might
> be interesting tough.
> 
> I needed some Code to extract the rotation-part from a transformation Matrix
> as a Quaternion. The following Code-parts are part of a project I´m
> currently working on.
> 
> The following V1 Code gives obviously the wrong result for the "rot" Matrix.
> 
> V2 and V3 are working as expected, but i think they internaly also use the
> matrix::factor() function. Thats what I found interesting.
> 
> Maybe someone could give me a hint, what i have done wrong in V1.
> 
> These results were produced by the CVS Version from 29.08.2004 with .NET
> 2003

hmm either documentation problem or bad interface design seem to be the
major problem. From OSGMatrix.h 

/*! \brief Factors a matrix m into 5 pieces: m = r s rt u t, where rt
    means transpose of r, and r and u are rotations, s is a scale,
    and t is a translation. Any projection information is returned
    in proj.
*/

template<class ValueTypeT> inline
bool TransformationMatrix<ValueTypeT>::factor(TransformationMatrix &r,
                                              VectorType3f         &s,
                                              TransformationMatrix &u,
                                              VectorType3f         &t,
                                              TransformationMatrix
&proj) const

in short the problem is that the first parameter r is the scale
orientation not the rotation, u (third parameter) is the rotation. If 
you change your testprogram to use u not r as the rotation you get
the same results as for the last two of your examples.

regards,
  gerrit




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to