The fourth row of the matrix VP

If you have a question about matrix multiplication. What information is stored in the fourth row of the display forecast matrix? I thought that the rotation and scaling information is stored in the top 3x3 matrix, the translation is then in the fourth column with the last element set to 1. I struggle because I get the following results for my VP matrix:

If there is no rotation and no translation (note that all values ​​are rounded):

0.34 0 0 0 0 0.61 0 0 0 0 -1 -0.2 0 0 -1 0 

Apply translation at -100:

 0.34 0 0 0 0 0.61 0 -61.73 0 0 -1 -0.2 0 0 -1 0 

Transfer to -100, then rotate 30 Β° along the positive axis X, then rotate 180 Β° along the positive axis Y:

 -0.34 0 -3 0 0 0.53 0.3 -53.46 0 -0.5 0.86 49.8 0 -0.5 0.8 50 

He does not fit me. The funny part: It works. So what is the information of this line?

 0 -0.5 0.8 50 

Thanks for the help!

+7
c ++ matrix-multiplication glm-math
source share
1 answer

For me, your matrix looks a little strange. Typically, the fourth line will contain the 4th component of a uniform frame of coordinates, that is, something like [x,y,z]/w , which would have to add up to 1 in the line for an affine transformation. I think your matrix works because the odd numbers in your fourth row count towards the top of 3x3 . You tried to change the order of matrix concatenation, for example, M'=M1*M0 vs. M'=M0*M1 . A very good explanation of uniform coordinates is given by Jim Blinn in his Dirty Pixels and articles.

In addition, this website contains a good step-by-step guide on homogeneous conversions.

0
source share

All Articles