Working with Graphic Elements > Classes > Matrix4 > Matrix4.setOrtho
setOrtho(left, right, bottom, top, near, far);
left. Left border coordinate.
right. Right border coordinate.
bottom. Top border coordinate.
top. Bottom border coordinate.
near. Distance between a camera to the near clipping plane.
far. Distance between a camera and far clipping plane.
The setOrtho method sets orthographic projection matrix.
The set parameters have the Number type.
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 ]); // Set orthographic projection matrix.setPerspective(5, 3, 2, 3, 5, 10); // Get matrix values matrix.getData(); // -> [-1, 0, 0, 0, 0, 2, 0, 0, 0, 0, -0.4000000059604645, 0, 4, -5, -3, 1]
After executing the example an orthographic projection matrix is set.
See also: