transformations question

Started by
13 comments, last by davidko 22 years, 6 months ago
quote:Original post by grhodes_at_work
That's not exactly correct. For example, a scaling transformation matrix is orthogonal:


[sfx 0 0 ]
S =| 0 sfy 0 |
[ 0 0 sfz]


But its transpose and inverse are the same only if sfx = sfy = sfz = 1.



First, how can you determine that your matrix is orthogonal?
A matrix, if my memory's still with me, is only called orthogonal if its inverse is the same as its transpose, and in your case the orthogonality depends on the variables' values.

Second, the following properties must be true for your matrix to be orthogonal:
sfx = +-1 sfy = +-1 sfz = +-1
So you can in fact get N=2^3=8 different matrices that are orthogonal, not only one.

To sum it up:
A*A(T)=I iff square matrix A is orthogonal.

regards




/Mankind gave birth to God.

Edited by - silvren on October 10, 2001 5:29:39 PM

Edited by - silvren on October 10, 2001 5:30:31 PM

Edited by - silvren on October 10, 2001 5:31:35 PM
/Mankind gave birth to God.
Advertisement
OOPS.. sorry, I realized my message had nothing to do with the discussion. What I was talking about is computing the world transform for a particular node in a scene graph structure, and the order of multiplication involved there, but what this post is talking about is "change of coordinates", between two separate nodes in the scene graph.

It's also better not to talk about this with the word "camera", because it may become confused with a camera transform for a particular coordinate system/device.

So "change of coordinates" is changing between two local coordinate systems, say A, and B. You have a coordinate in A's local system, and you want to interpret it in B's local system.
In this case, you have to multiply A's coordinate first by A's world transform, to get the coordinate into world coordinates. Then multiply it by the inverse of B's world transform. So it's actually A * B(T)? heh, or it might be B(T) * A..

--bart



Edited by - bpj1138 on October 10, 2001 5:34:34 PM
--bart
quote:Original post by silvren
First, how can you determine that your matrix is orthogonal?
A matrix, if my memory''s still with me, is only called orthogonal if its inverse is the same as its transpose, and in your case the orthogonality depends on the variables'' values.

Second, the following properties must be true for your matrix to be orthogonal:
sfx = +-1 sfy = +-1 sfz = +-1
So you can in fact get N=2^3=8 different matrices that are orthogonal, not only one.

To sum it up:
A*A(T)=I iff square matrix A is orthogonal.


silvren, you are absolutely correct on both points. Thanks for calling me on my error. What the hell was I thinking? (Ever hear of a brain fart?)

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
It''s true that orientation matrix with a position vector is not "orthogonal square matrix", so you cannot transpose it. To compute the inverse, you can still transpose the 3x3 axis vector matrix, but then you have to negate the position vector and dot it with the three axis vectors.

so if you have the orientation matrix (R = right, U = up, D = direction, P = position):

|Rx Ry Rz 0|
|Ux Uy Uz 0|
|Dx Dy Dz 0|
|Px Py Pz 1|

the inverse orientation matrix is:

|Rx Ux Dx 0|
|Ry Uy Dy 0|
|Rz Uz Dz 0|
|-P*R -P*U -P*D 1|

notice the three axis vectors are still simply transposed from columns to rows. the position vector has to be negated and dotted with the three axis (in the original matrix, not the inverse)

--bart




--bart
Normally, for graphics stuff, the interest in having an orthogonal matrix stems from wanting to efficiently transform normals, in which case translation doesn''t even factor in (i.e. how do you tranlate a normal)? So the usual textbook answer is, yes, if you have a rotation, translation, and uniform scaling, then your matrix is orthogonal. Of course, they usually say this in the context of normals, since translating a model will not affect its normals.

This topic is closed to new replies.

Advertisement