Jump to content
  • Advertisement
Sign in to follow this  
Love3DGraphiks

OpenGL Matrix ModelView Confusing

This topic is 4430 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

I read the book OpenGL SuperBible 3rd ,in Transformation Section they give a figure about Matrix MODELVIEW like this
| Xx  Yx  Zx  Tx |
| Xy  Yy  Zy  Ty |
| Xz  Yz  Zz  Tz |
| 0   0   0   1  |

so when it performs the transformation it should do like this
| Xx  Yx  Zx  Tx |     | Px |
| Xy  Yy  Zy  Ty |  x  | Py |
| Xz  Yz  Zz  Tz |     | Pz |
| 0   0   0   1  |     |  1 |
right???

So heres the problems 
X,Y,Z is the Othorgonal Vector and they make up the Basic but why  are they arranged in the Matrix like that ? It should be in my opinion like this
| Xx  Xy  Xz  Tx |    | Px |
| Yx  Yy  Yz  Ty |  x | Py |   -> I think this is the right order
| Zx  Zy  Zz  Tz |    | Pz |
| 0   0   0   1  |    |  1 |

Anyone give me some expalins ??? Thanks

Share this post


Link to post
Share on other sites
Advertisement

Your P' = M x P should be a linear combination of your basis vectors X,Y,Z, T. If your basis vectors are on the rows, you don't end up with a linear combination

You would get

Px = Xx * Px + Xy * Py + Xz * Pz + Tx
Py = ...
Pz = ...

Notice each component of P only depends on 1 basis vector instead of all four. You want

P = a*X+b*Y+c*Z+1*D where a,b,c are scalars

Share this post


Link to post
Share on other sites
Have you taken linear algebra?

The way I like to think of it is that Xx, Xy, Xz says how much the x-component of the vector being transformed contributes to each of the X,Y, and Z coordinates of the image of the vector under the transformation.

Notice your labels are just flipped, so it doesn't mean much. You might be thinking of it the correct way but the labels are just confusing you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!