transformations question
#1 Members  Reputation: 122
Posted 07 October 2001  05:46 PM
#2 Members  Reputation: 122
Posted 07 October 2001  11:28 PM
quote:
Now, if we want to transform a point in camera space to model space, we simple do this:
X = world_to_camera(T) * model_to_world(T) * X''
Is that really true!?
I think the correct transformation is this:
X = model_to_world(T) * world_to_camera(T) * X''
regards
/Mankind gave birth to God.
#6 Members  Reputation: 113
Posted 09 October 2001  02:11 PM
world_transform = root_node * node1 * node2 * node3.. * local_object_transform
So, the parent transforms are on the left, just as you''d expect.
bart
#7 Members  Reputation: 122
Posted 09 October 2001  09:03 PM
I''m sorry but I don''t know what you mean. I just corrected davidko''s second transformation, which ought to be right now. So, what do you mean?
I haven''t looked up any formulas (no need to) but I''m pretty confident that I have reasoned correctly.
Could you explain a bit more?
/Mankind gave birth to God.
#8 Members  Reputation: 491
Posted 09 October 2001  11:55 PM
#9 Members  Reputation: 122
Posted 10 October 2001  12:23 AM
quote:
Original post by LilBudyWizer
I take it you mean rotations only and not rotations and translations since I don't think the transpose and inverse are the same when translations are included. I'm not particularly strong with matrices but when I tried multiplying a matrix that included translation by its transpose I didn't get the identity matrix.
You're right. Ortogonal matrices' inverses are simply the transposes. Rotation matrices are ortogonal, and translation matrices are not ortogonal.
/Mankind gave birth to God.
Edited by  silvren on October 10, 2001 7:26:38 AM
#10 Members  Reputation: 1377
Posted 10 October 2001  04:55 AM
quote:
Original post by silvren
You're right. Ortogonal matrices' inverses are simply the transposes.
That's not exactly correct. For example, a scaling transformation matrix is orthogonal:

But its transpose and inverse are the same only if sfx = sfy = sfz = 1.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Edited by  grhodes_at_work on October 10, 2001 11:55:42 AM
Edited by  grhodes_at_work on October 10, 2001 7:14:12 PM
#11 Members  Reputation: 122
Posted 10 October 2001  10:28 AM
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
#12 Members  Reputation: 113
Posted 10 October 2001  10:31 AM
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
#13 Members  Reputation: 1377
Posted 10 October 2001  12:13 PM
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.
#14 Members  Reputation: 113
Posted 10 October 2001  12:55 PM
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
#15 Members  Reputation: 122
Posted 10 October 2001  03:53 PM