The 16 parts of the Viewing Matrix
hey,
I have been looking in to a way to find my coordinates in OpenGL after I have rotated then translated.
I have discovered that you can retrieve the 16 parts of a matrix using glGet();
Does anyone here know what the 16 parts actually relate to in regards to the View Model Matrix? If three of these relate to the position, I should be able to get my new coordinates using this command.
Help would be much appreciated,
Thanks,
Dachande
>>I have been looking in to a way to find my coordinates in OpenGL after I have rotated then translated.<<
u should be keeping track of this yourself its not that difficult to workout where u are (+ quicker than using glGet(..))
but anyways they are the 12,13,14 numbers from the modelview matrix
http://uk.geocities.com/sloppyturds/gotterdammerung.html
u should be keeping track of this yourself its not that difficult to workout where u are (+ quicker than using glGet(..))
but anyways they are the 12,13,14 numbers from the modelview matrix
http://uk.geocities.com/sloppyturds/gotterdammerung.html
yah.
0,1,2, 4,5,6, 8,9,10 form a 3x3 rotation matrix, where, as mentioned, 12,13 and 14 are a 3 part vector which is the position of the ''camera''. Note that these numbers are scaled by 15, which defaults to 1 though, so it usually doesn''t matter.
0,1,2, 4,5,6, 8,9,10 form a 3x3 rotation matrix, where, as mentioned, 12,13 and 14 are a 3 part vector which is the position of the ''camera''. Note that these numbers are scaled by 15, which defaults to 1 though, so it usually doesn''t matter.
Those three indices do represent the translational component of the transform. They DO NOT represent the new position of your point, which I gather from your other post is really what you are after. You must multiply the point by the transformation matrix to get the transformed position of the point. I hate to say it, but you HAVE to invest the time to learn vector and matrix math if you want to do 3d. Linear algrebra is unavoidable. You will not be able to do anything even marginally complicated without it (no physics, collision detection, ai, etc.). I suggest you start by writing your own vector and matrix classes and familiarizing yourself with their operations.
new_position = transform * position;
where new_position and position are 4 dimensional vectors and transform is a 4x4 matrix.
new_position = transform * position;
where new_position and position are 4 dimensional vectors and transform is a 4x4 matrix.
ops. didn''t read my own code.
it''s true, you do have to multiply the values first... it has to be negated, then multiplied through the inverse of the 3x3 matrix (if you don''t scale, then the transpose will do)
it''s true, you do have to multiply the values first... it has to be negated, then multiplied through the inverse of the 3x3 matrix (if you don''t scale, then the transpose will do)
eighter try to use gluProject / gluUnproject or learn how matrices work.
"take a look around" - limp bizkit
www.google.com
"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement