Working with Graphic Elements > Classes > Matrix4 > Matrix4.setIdentity
setIdentity();
The setIdentity method sets an identify matrix.
The method sets matrix with values:
[ 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1 ]
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(); // Set identify matrix matrix.setIdentity(); // Get matrix values matrix.getData(); // -> [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
After executing the example a 4x4 identify matrix.
See also: