Show contents 

Working with Graphic Elements > Classes > Matrix4 > Matrix4.calcNormMatrix

Matrix4.calcNormMatrix

Syntax

calcNormMatrix(): Array;

Description

The calcNormMatrix method calculates normal matrix.

Comments

The method returns a 3x3 normal matrix.

Example

To execute this example, in the HEAD tag of HTML page specify links to the following JS and CSS files: PP.js, PP.GraphicBase.js. Create a new matrix:

// Create a matrix
matrix = new PP.Matrix4([
4.717621803283691, 0, 0, 0, 
0, 10.385396957397461, 0, 0,
0, 0, -1.0000020265579224, -1, 
0, 0, -0.002000001957640052, 0
]);
// Calculate normal matrix
matrix.calcNormMatrix();
// -> [0.2119712084531784, -0, -0, -0, 0.09628904610872269, 0, -0, 0, -0.9999979734420776]

After executing the example the console displays normal matrix.

See also:

Matrix4