3Д БУМ

3Д принтеры и всё что с ними связано

Transposing Matrices

Transposing matrices is important in game programming because it is a fast, easy way to calculate the inverse of orthogonal matrix. Now, let your brain relax a bit; this operation is much easier. To transpose a

matrix all you have to do is take the columns of the matrix and make them the rows, and vice versa. The original matrix is orthogonal if when you multiply it by its transpose, you end with the identity matrix (M(Mt) = I). As you know from the last function, a matrix multiplied by its inverse is also the identity matrix. It stands to reason that the transpose of the original matrix must also be its inverse. An example of an orthogonal matrix is the rotation matrix, which I will talk about later in the chapter. This is a piece of cake compared to matrix multi­plication; just check out Figure 1.12.

~1

2

3~

~1

4

7~

A =

4

5

6

Л‘ =

2

5

8

7

8

9

3

6

9

Figure 1.12 Left:The original matrix. Right:The matrix after it has been transposed. This is frequently done in game programming to find the inverse of rotation and other orthogonal matrices.

Для любых предложений по сайту: [email protected]