Need Math Help. :(
Apr. 1st, 2005 01:58 amDear Mathgeek friends,
Please save my wall from any more head-shaped dents and explain to me why I am too stupid to figure this out?
I have an object with a local axis at WORLD location 5,0,10. I can output a 16-number array from this which is really a 4x4 matrix.
If the object is set to rotation 0,0,0 The matrix looks like this:
I believe the 4th column is unused in this table. (It's a rotation/transformation matrix is what it's called BTW)
Next I'm applying a relative rotation to X, then Y, and finally Z. Let's say (3, 7, 11) will be my rotations and I'm applying them in order wtih the object orientation.
rotate 3 0 0 produces the following:
rotate 0 7 0 changes it to be
And finally, putting 11 in the Z position:
Now... What I want and have been desperately beating my head on for a week is... How do I get from the last set of numbers back to the numbers '3,7,11'?
I've read numerous docs and stared at http://www.gamedev.net/reference/articles/article695.asp endlessly.
I know the answer is there, and many of the solutions I've tried get antagonistically close (but not close enough to just be rounding error)
So someone help me. What's the matrix transformation to get my numbers back?
I know it's something along the lines of this:
(Where A,B, and C were my original X, Y, and Z X,Y,and Z are the numbers in 'Rotation' and M is the matrix)
But I just can't figure it out.
If someone could please help me, I'd be forever grateful. It's so frustrating because I know I _should_ understand this because it's not that complex of a problem but for some reason it just isn't sticking and I can't find the solution imperically either. Please help? Please please please? I can't sleep, I can't focus at work, this thing is devouring my brain because I know I'm missing something stupid and when I understand it, I'm going to scream and pull all of my hair out for being such an idiot. I'm desperate here. :/
Please save my wall from any more head-shaped dents and explain to me why I am too stupid to figure this out?
I have an object with a local axis at WORLD location 5,0,10. I can output a 16-number array from this which is really a 4x4 matrix.
If the object is set to rotation 0,0,0 The matrix looks like this:
1 0 0 0
0 1 0 0
0 0 1 0
5 0 10 1
I believe the 4th column is unused in this table. (It's a rotation/transformation matrix is what it's called BTW)
Next I'm applying a relative rotation to X, then Y, and finally Z. Let's say (3, 7, 11) will be my rotations and I'm applying them in order wtih the object orientation.
rotate 3 0 0 produces the following:
rotations: 3,0,0
matrix:
1 0 0 0
0 0.99863 0.052336 0
0 -0.052336 0.99863 0
5 0 10 1
rotate 0 7 0 changes it to be
rotations: 3.022488 6.990359 0.36818
matrix:
0.992546 0.00637815 -0.121702 0
0 0.99863 0.052336 0
0.121869 -0.0519459 0.991186 0
5 0 10 1
And finally, putting 11 in the Z position:
rotations: 4.303946 6.285349 11.419949
matrix:
0.97431 0.196808 -0.10948 0
-0.189387 0.979065 0.0745963 0
0.121869 -0.0519459 0.991186 0
5 0 10 1
Now... What I want and have been desperately beating my head on for a week is... How do I get from the last set of numbers back to the numbers '3,7,11'?
I've read numerous docs and stared at http://www.gamedev.net/reference/articles/article695.asp endlessly.
I know the answer is there, and many of the solutions I've tried get antagonistically close (but not close enough to just be rounding error)
So someone help me. What's the matrix transformation to get my numbers back?
I know it's something along the lines of this:
(Where A,B, and C were my original X, Y, and Z X,Y,and Z are the numbers in 'Rotation' and M is the matrix)
A = X*M[0,0] + Y*M[0,1] + Z*M[0,2] B = X*M[1,0] + Y*M[1,1] + Z*M[1,2] C = X*M[2,0] + Y*M[2,1] + Z*M[2,2]
But I just can't figure it out.
If someone could please help me, I'd be forever grateful. It's so frustrating because I know I _should_ understand this because it's not that complex of a problem but for some reason it just isn't sticking and I can't find the solution imperically either. Please help? Please please please? I can't sleep, I can't focus at work, this thing is devouring my brain because I know I'm missing something stupid and when I understand it, I'm going to scream and pull all of my hair out for being such an idiot. I'm desperate here. :/
(no subject)
Date: 2005-04-01 08:23 pm (UTC)You're rotating a point around a coordinate. this 'center of rotation' coordinate is known.
(example, [5,0,10])
You know the point's starting coordinates.. and ending coordinates.
(example, starts at [3,0,10].. ends at [5,-2,10])
You WANT the angle and axis around which the point rotated??
(in this case it would be a 90 degree angle around an axis parallel to the 'Z' axis but placed at 5,0,10)
Is this basically the type of problem you're trying to solve?
(no subject)
Date: 2005-04-01 08:41 pm (UTC)