Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Matrix ModelView Confusing

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

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

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!