/** * 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; }
/** * 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 model view matrix. */ protected void updateModelViewMatrix() { _modelView.setIdentity(); _modelView.setM00(-_left.getX()); _modelView.setM10(-_left.getY()); _modelView.setM20(-_left.getZ()); _modelView.setM01(_up.getX()); _modelView.setM11(_up.getY()); _modelView.setM21(_up.getZ()); _modelView.setM02(-_direction.getX()); _modelView.setM12(-_direction.getY()); _modelView.setM22(-_direction.getZ()); _modelView.setM30(_left.dot(_location)); _modelView.setM31(-_up.dot(_location)); _modelView.setM32(_direction.dot(_location)); }
/** * Updates the value of our view matrix. */ protected void updateViewMatrix() { _view.setIdentity(); _view.setM00(-_left.getX()); _view.setM10(-_left.getY()); _view.setM20(-_left.getZ()); _view.setM01(_up.getX()); _view.setM11(_up.getY()); _view.setM21(_up.getZ()); _view.setM02(-_direction.getX()); _view.setM12(-_direction.getY()); _view.setM22(-_direction.getZ()); _view.setM30(_left.dot(_location)); _view.setM31(-_up.dot(_location)); _view.setM32(_direction.dot(_location)); }
result.setM02(xz + yw); result.setM10(xy + zw); result.setM11(1.0 - (xx + zz)); result.setM12(yz - xw); result.setM20(xz - yw);
result.setM02(xz + yw); result.setM10(xy + zw); result.setM11(1.0 - (xx + zz)); result.setM12(yz - xw); result.setM20(xz - yw);
rangeMatrix.setM11(maxY - minY); rangeMatrix.setM30(minX); rangeMatrix.setM31(minY);
rangeMatrix.setM11(maxY - minY); rangeMatrix.setM30(minX); rangeMatrix.setM31(minY);
matrix = new Matrix4(); matrix.setM00(0.8); matrix.setM11(0.8); dudvTexture.setTextureMatrix(matrix); textureState.setTexture(dudvTexture, 2);
mat4A.setM03(0.3); mat4A.setM10(1.0); mat4A.setM11(1.1); mat4A.setM12(1.2); mat4A.setM13(1.3);