Table 5.5. Matrix functions

Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. Note: To get linear-algebraic matrix multiplication, use the multiply operator (*).

These functions produce the component-wise multiplication of two matrices. For instance, the result of calling matrixCompMult with two 3D matrices x and y looks like this:

mat3 x, y, newmat;
. . .
newmat = matrixCompMult(x, y);

This is not usually what you want if you are using matrices to represent transformation steps. In this case, you would use the multiply operator (*) to perform the linear-algebraic matrix multiplication