Re: Getting Orthonormal Mat

New Message Reply Date view Thread view Subject view Author view

Alejandro Saez (cano++at++krusty.engr.sgi.com)
Tue, 13 Oct 1998 11:39:32 -0500


On Oct 13, 7:51pm, Tarun K. Chaturvedi wrote:
> Subject: Getting Orthonormal Mat
> I am integrating RAPID_Collide in a Performer application, and using a
> getDCS function to get rotation Matrix(3*3). RAPID_Collide function
> needs orthonormal rotation matrix to be passed as a parameter.
> But when I am checking for orthonormal property of Matrics( A matrix
> is said to be Orthonormal if multiplication of original Mat and
> Transpose Mat of the Mat is Identity Mat.) I am getting diagonal
> elements 1.000001, 1.000004,something like this. Basically I need Mat
> having Orthonormal property not Identity Mat. Is there any way to get
> orthonormal rotation matrix in Performer ? Will DCS Node of Performer
> gives Orthonormal Mat ? Can anyone give me any clue?
>
>
>
> tarun,
>
> tarun++at++ada.ernet.in
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Tarun K. Chaturvedi

The answer is yes, but it doesn't have to do with Performer, but with
properties inherent to certain operations, that is, you can't MAKE a matrix
orthonormal, the matrix IS orthonormal or not. Well, what operations gives an
orthonormal matrix as a result? Given an identity matrix, if you apply a
rotation to it, the resulting matrix will be orthonormal, you can easily check
this considering the upper left sub-matrix of a 2D rotation matrix

            M * M Transposed = I
[ cos(x) -sin(x)] * [cos(x) sin(x)]= [1 0]
[ sin(x) cos(x)] [-sin(x) cos(x)] [0 1]

As you can see (do the math), it doesn't depend on the angle or anything, it is
a property of rotations, and all rotation matrices (including 3D) will show
that properties. Now if the matrix is also used to do scaling then the
resulting matrix will no longer be orthonormal. The nice thing about them is
that to get the inverse transform (screen to world), you need only to transpose
the matrix which is MUCH faster than having to calculate it (determinant and
all that) , which I guess is why you are being required to use orthonormal
matrices (there isn't really any other technical reason but speed, I don't know
much about RAPID_collide, but RAPID suggests a reason).

In other words, if the matrix is only being used for rotations it will be
orthonormal in theory, but please, don't expect a computer to evaluate
(cos x)^2 + (sin x)^2 as 1.0000000000 for any given x angle, much less with 32
bits precision, it just won't.

------------------------------------------------------------------------
Alejandro Saez
Software Engineer
Silicon Chile S.A.
                                        Avda. Santa Maria 2560
E-mail: asaez++at++silicon.cl Providencia
Phone: +56 (2) 203 3371 Ext. 107 Santiago
Fax: +56 (2) 203 3370 Chile
------------------------------------------------------------------------

-- 

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Oct 13 1998 - 08:37:01 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.