Projection.setModelMatrix

Syntax

setModelMatrix(value: PP.Matrix4);

Parameters

value. 4x4 matrix.

Description

The setModelMatrix method sets model and view matrix.

Example

To execute the example, the <head> tag of HTML page must include links to the script files PP.js, PP.GraphicsBase.js. Create a class object used to work with 3D projection and set a new model and view matrix for it:

// Create a class object used to work with 3D projection
var projection = new PP.Projection();
// Set a new model and view matrix
var matix = new PP.Matrix4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
projection.setModelMatrix(matix);
// Get model and view matrix
console.log("Model and view matrix: ");
console.log(projection.getModelMatrix().getData());

As a result the console displays model and view matrix:

Model and view matrix:

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]

See also:

Projection