* 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)
| 16373 | * @returns {mat4} out |
| 16374 | */ |
| 16375 | function 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…