MCPcopy Index your code
hub / github.com/plotly/plotly.js / ortho

Function ortho

stackgl_modules/index.js:16375–16396  ·  view source on GitHub ↗

* Generates a orthogonal projection matrix with the given bounds * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} left Left bound of the frustum * @param {number} right Right bound of the frustum * @param {number} bottom Bottom bound of the frustum * @param {num

(out, left, right, bottom, top, near, far)

Source from the content-addressed store, hash-verified

16373 * @returns {mat4} out
16374 */
16375function ortho(out, left, right, bottom, top, near, far) {
16376 var lr = 1 / (left - right),
16377 bt = 1 / (bottom - top),
16378 nf = 1 / (near - far);
16379 out[0] = -2 * lr;
16380 out[1] = 0;
16381 out[2] = 0;
16382 out[3] = 0;
16383 out[4] = 0;
16384 out[5] = -2 * bt;
16385 out[6] = 0;
16386 out[7] = 0;
16387 out[8] = 0;
16388 out[9] = 0;
16389 out[10] = 2 * nf;
16390 out[11] = 0;
16391 out[12] = (left + right) * lr;
16392 out[13] = (top + bottom) * bt;
16393 out[14] = (far + near) * nf;
16394 out[15] = 1;
16395 return out;
16396};
16397
16398/***/ }),
16399

Callers 1

calcCameraParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…