• 13
• 18
• 19
• 27
• 10

# OpenGL Matrix ModelView Confusing

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

## 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 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 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.