Hi,
for the translation matrix:
1 0 0 0
0 1 0 0
0 0 1 0
tx ty tz 1
how do i get values for tx, ty, tz based on the pitch, yaw, and roll?
thanks,
Scott
------------------------------------------------------------
Email
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
3D Translations.... almost got it
Pitch, yaw and roll are rotations, so wouldn''t appear in a translation matrix.
- Pete
- Pete
ah, okie...
then how do/and from what do I get values for tx, ty, tz?
------------------------------------------------------------
Email
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
then how do/and from what do I get values for tx, ty, tz?
------------------------------------------------------------
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
In OpenGL
I don''t do DX.
double modelview[16], projection[16]glGetDoublev( GL_MODELVIEW_MATRIX, modelview );glGetDoublev( GL_PROJECTION_MATRIX, projection );
I don''t do DX.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
in DX,
D3DXMatrixTranslation(&MatrixT, XPosition, YPosition, ZPosition);
produces translation matrix MatrixT
henry
D3DXMatrixTranslation(&MatrixT, XPosition, YPosition, ZPosition);
produces translation matrix MatrixT
henry
HenryLecturer in Computer Games TechnologyUniversity of Abertay DundeeScotlandUK
I''m not sure the question was stated clearly. If this is a question about OpenGL or DirectX, it belongs in a different forum. Please state the question more clearly and specifically.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
well, i''m using OpenGL, but I didn''t think it matter which API i was using. Anywho, Tx, Ty and Tz are the distances along the x, y and z axis that we want to translate right? So how do get that vector? I''m not sure how to convert the 3 Angles to a vector, assuming that''s what I need to do.
Thanks,
Scott
Sorry for the lack of info, I probably left more out too
------------------------------------------------------------
Email
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
Thanks,
Scott
Sorry for the lack of info, I probably left more out too
------------------------------------------------------------
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
quote:
Original post by wojtos
well, i''m using OpenGL, but I didn''t think it matter which API i was using. Anywho, Tx, Ty and Tz are the distances along the x, y and z axis that we want to translate right? So how do get that vector? I''m not sure how to convert the 3 Angles to a vector, assuming that''s what I need to do.
I didn''t think the API was part of your question, .
So now I think I understand your question. You are representing your translation axis in terms of a pitch, yaw, and roll. And you would like to convert that axis into a vector whose components are (tx, ty, tz).
The order of application of roll, pitch, yaw is important. Assuming you first apply roll about the x axis, followed by pitch about y axis, and lastly yaw about the z axis then you can generate a rotation matrix (yes, matrix) as:
|
Then, one of the columns of this matrix will define your vector (tx, ty, tz). Which column will depend on which axis points to the front of your object (i.e., if the object''s x axis points to the front, choose the first column).
So you may have to adjust the matrix if your pitch, roll, yaw are applied in a different order (just rename things in my matrix to match your order), and choose a different column to be your (tx, ty, tz) depending on which axis points to the front of your object.
Hope that helps.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Um, maybe i'm really messed up, i'm getting some really weird results. What are the correct, or one of the various correct order of methods? My code looks like this:
For one thing, it rapidly accelerates, and i'm not sure where to add the velocity (or magnitude?).
the matrices i'm using look are order by row:
[ 00 01 02 03 ]
| 10 11 12 13 |
| 20 21 22 23 |
[ 30 31 32 33 ]
Thanks, I really appreciate it
Scott
------------------------------------------------------------
Email
Website
"If you try and don't succeed, destroy all evidence that you tried."
------------------------------------------------------------
Edited by - wojtos on November 26, 2001 9:18:29 PM
For one thing, it rapidly accelerates, and i'm not sure where to add the velocity (or magnitude?).
the matrices i'm using look are order by row:
[ 00 01 02 03 ]
| 10 11 12 13 |
| 20 21 22 23 |
[ 30 31 32 33 ]
|
Thanks, I really appreciate it
Scott
------------------------------------------------------------
Website
"If you try and don't succeed, destroy all evidence that you tried."
------------------------------------------------------------
Edited by - wojtos on November 26, 2001 9:18:29 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement