Coordinate systems
Greetings!
How can I convert a ray presented by the vectors "direction" and point into a coordinate system defined by a 4*4 matrix? How do I calculate these vectors that they are relative to the axes and the origin of the matrix?
Everything you could want and more is at http://www.makegames.com/3drotation/, about halfway down the page.
(Important things to note are the 3D rotation matrix and how to combine translations and rotations...)
~ Dragonus
(Important things to note are the 3D rotation matrix and how to combine translations and rotations...)
~ Dragonus
![](wink.gif)
Now I will work with formulas...
I have two 3d-vectors (v1, v2) and two 4*4 matrices (m1, m2).
I apply the following calculations:
1.) v1*m1=v2
2.) v2*m2=v1
How do I calculate m2 by the given m1? You see m2 undos the transformation of v1 by m1.
I have two 3d-vectors (v1, v2) and two 4*4 matrices (m1, m2).
I apply the following calculations:
1.) v1*m1=v2
2.) v2*m2=v1
How do I calculate m2 by the given m1? You see m2 undos the transformation of v1 by m1.
Given the following:
1.) v1*m1=v2
2.) v2*m2=v1
Simple algebra tells us this:
m2 = v1/v2
m1 = v2/v1
So, as you can see, m1 is the inverse of m2.
1.) v1*m1=v2
2.) v2*m2=v1
Simple algebra tells us this:
m2 = v1/v2
m1 = v2/v1
So, as you can see, m1 is the inverse of m2.
quote:
Original post by TerranFury
Given the following:
1.) v1*m1=v2
2.) v2*m2=v1
Simple algebra tells us this:
m2 = v1/v2
m1 = v2/v1
So, as you can see, m1 is the inverse of m2.
Your analysis is only true for scalar mathematics. However, it does lead to the correct result. I won't bother explaining why, but basically division is not defined for matrices.
It is correct to write
v2*m2 = v1
=>(v1*m1)*m2 = v1
=>v1*(m1*m2) = v1
which is only true if: m1*m2 = I (the identity matrix), and this is true if m2 = m1-1.
As to how you compute the inverse of a matrix... there are many methods. There was a good thread recently on this very topic that outlined peoples favourite matrix inversion techniques. One suggestion... avoid the Adjoint method.
Timkin
Edited by - Timkin on August 20, 2001 2:49:39 AM
Well, the two methods I do know of are like this: Let''s say...
The first way of doing this is by setting up the matrix [A | I] and then row-reducing it...
The part on the right half of the matrix when you''re done is A^-1.
They have a closed-equation way of doing it, but I don''t know the one for a 4x4 matrix.
Then there''s the adjoint. Kinda nasty on the math side, but it''ll be easier to code up on the computer side. Don''t remember it off the top of my head, but it''s not incredibly horrible as I remember...
Dragonus![](wink.gif)
Thought of the Moment
If F = ma, and Work = Fd, then does Work = mad?
|
The first way of doing this is by setting up the matrix [A | I] and then row-reducing it...
|
The part on the right half of the matrix when you''re done is A^-1.
They have a closed-equation way of doing it, but I don''t know the one for a 4x4 matrix.
Then there''s the adjoint. Kinda nasty on the math side, but it''ll be easier to code up on the computer side. Don''t remember it off the top of my head, but it''s not incredibly horrible as I remember...
Dragonus
![](wink.gif)
Thought of the Moment
If F = ma, and Work = Fd, then does Work = mad?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement