/** * Updates the value of our projection matrix. */ protected void updateProjectionMatrix() { if (getProjectionMode() == ProjectionMode.Parallel) { _projection.setIdentity(); _projection.setM00(2.0 / (_frustumRight - _frustumLeft)); _projection.setM11(2.0 / (_frustumTop - _frustumBottom)); _projection.setM22(-2.0 / (_frustumFar - _frustumNear)); _projection.setM30(-(_frustumRight + _frustumLeft) / (_frustumRight - _frustumLeft)); _projection.setM31(-(_frustumTop + _frustumBottom) / (_frustumTop - _frustumBottom)); _projection.setM32(-(_frustumFar + _frustumNear) / (_frustumFar - _frustumNear)); } else if (getProjectionMode() == ProjectionMode.Perspective) { _projection.setIdentity(); _projection.setM00((2.0 * _frustumNear) / (_frustumRight - _frustumLeft)); _projection.setM11((2.0 * _frustumNear) / (_frustumTop - _frustumBottom)); _projection.setM20((_frustumRight + _frustumLeft) / (_frustumRight - _frustumLeft)); _projection.setM21((_frustumTop + _frustumBottom) / (_frustumTop - _frustumBottom)); _projection.setM22(-(_frustumFar + _frustumNear) / (_frustumFar - _frustumNear)); _projection.setM23(-1.0); _projection.setM32(-(2.0 * _frustumFar * _frustumNear) / (_frustumFar - _frustumNear)); _projection.setM33(-0.0); } _updatePMatrix = false; }
/** * Updates the value of our projection matrix. */ protected void updateProjectionMatrix() { if (getProjectionMode() == ProjectionMode.Orthographic) { _projection.setIdentity(); _projection.setM00(2.0 / (_frustumRight - _frustumLeft)); _projection.setM11(2.0 / (_frustumTop - _frustumBottom)); _projection.setM22(-2.0 / (_frustumFar - _frustumNear)); _projection.setM30(-(_frustumRight + _frustumLeft) / (_frustumRight - _frustumLeft)); _projection.setM31(-(_frustumTop + _frustumBottom) / (_frustumTop - _frustumBottom)); _projection.setM32(-(_frustumFar + _frustumNear) / (_frustumFar - _frustumNear)); } else if (getProjectionMode() == ProjectionMode.Perspective) { _projection.setIdentity(); _projection.setM00((2.0 * _frustumNear) / (_frustumRight - _frustumLeft)); _projection.setM11((2.0 * _frustumNear) / (_frustumTop - _frustumBottom)); _projection.setM20((_frustumRight + _frustumLeft) / (_frustumRight - _frustumLeft)); _projection.setM21((_frustumTop + _frustumBottom) / (_frustumTop - _frustumBottom)); _projection.setM22(-(_frustumFar + _frustumNear) / (_frustumFar - _frustumNear)); _projection.setM23(-1.0); _projection.setM32(-(2.0 * _frustumFar * _frustumNear) / (_frustumFar - _frustumNear)); _projection.setM33(-0.0); } _updatePMatrix = false; }
mat4A.setM31(3.1); mat4A.setM32(3.2); mat4A.setM33(3.3);