Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Thor82

What do modelview / projection /texture matrices Contains?

This topic is 5578 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I SEARCHED GOOGLE! i didn''t find nothing useful, maybe too because i don''t know exactly what to put in the search string, i realized that the modelview contains Sx__??__??__?? ??__Sy__??__?? ??__??__Sz__?? Px__Py__Pz__?? where S is Scale (modified with glScalef) P is position (modified with gltranslate) but what does other data contains? thanks
There aren''''t problems that can''''t be solved with a gun...

Share this post


Link to post
Share on other sites
Advertisement
I would think of it as decomposing each matrix into a
top-left 3x3, a bottom 1x3, a right 3x1 and the number 1
in the bottom right:



M = [ R | 0 ]
[-------]
[ T | 1 ]

T = translation
R = rotation (may contain scale, if your models are
appear at diffent scales)
0 = zero vector. Put non-zero values here only if you are
after strange effects.

P = [ R | P ]
[-------]
[ T | 1 ]
R : The rotation in the projection matrix is usually
simple and "axis aligned". ie, it allows you to think
of your camera looking down/up the X/Y or Z axis.

T : is a translation - but it can be static depending
you your app. ie, You can use it to "position the eye at 1.0,
looking down the Z axis" - you then manupulate the model view
to move things in this logical space.

P: Perspective vector - Ususally this would only have a z component, calculated to give a certain FoV.



I like to think of it as : Proj=Position you eye,
MV = position your data w.r.t. your eye. Make changes
to your eye (eg, zooming in using a "sight") in the Proj matrix, Move your models around using the model view.

Share this post


Link to post
Share on other sites
Wow,those are a lot of info, thanks a lot!



There aren''''t problems that can''''t be solved with a gun...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!