computeModelViewProjectionMatrixAndReturnNew

Computes model-view projection matrix using provided projection and model-view matrices.

The model-view projection matrix is the combination of both the projection and the model-view matrices that OpenGL uses to draw the scene.

Provided arrays must have 16 length to contain the values of 4x4 matrices.

Return

16-length array containing the model-view projection matrix values.

Parameters

projectionMatrix

projection matrix. Must have length 16.

modelViewMatrix

model-view matrix. Must have length 16.


fun computeModelViewProjectionMatrixAndReturnNew(camera: PinholeCamera, width: Int, height: Int, nearPlane: Float, farPlane: Float): FloatArray

Computes model-view projection matrix using provided pinhole camera, viewport size expressed in pixels, near and far planes and field of view.

The model-view projection matrix is the combination of both the projection and the model-view matrices that OpenGL uses to draw the scene.

The viewport is the surface where the scene is rendered. OpenGL internally normalizes viewport coordinates from -1.0 to 1.0, but the hardware needs to know the actual size of the surface expressed in pixels.

Near and far planes define the region of the 3D space that is actually drawn. Any vertex being at a depth closer to the camera than the near plane, or any vertex being at a depth further from the camera than the far plane, is ignored and not drawn.

The field of view defines how wide is the region of the visible space. It is closely related to the focal length of the pinhole camera intrinsic parameters, and related to the amount of zoom of the scene.

Return

16-length array containing the model-view projection matrix values.

Parameters

camera

pinhole camera.

width

width of viewport expressed in pixels.

height

height of viewport expressed in pixels.

nearPlane

near plane defining the closest visible vertices.

farPlane

far plane defining the furthest visible vertices.


fun computeModelViewProjectionMatrixAndReturnNew(intrinsicParameters: PinholeCameraIntrinsicParameters, cameraRotation: Rotation3D, cameraCenter: Point3D, width: Int, height: Int, nearPlane: Float, farPlane: Float): FloatArray

Computes model-view projection matrix using provided intrinsic pinhole camera parameters, viewport size expressed in pixels, near and far planes and field of view.

The model-view projection matrix is the combination of both the projection and the model-view matrices that OpenGL uses to draw the scene.

The viewport is the surface where the scene is rendered. OpenGL internally normalizes viewport coordinates from -1.0 to 1.0, but the hardware needs to know the actual size of the surface expressed in pixels.

Near and far planes define the region of the 3D space that is actually drawn. Any vertex being at a depth closer to the camera than the near plane, or any vertex being at a depth further from the camera than the far plane, is ignored and not drawn.

The field of view defines how wide is the region of the visible space. It is closely related to the focal length of the pinhole camera intrinsic parameters, and related to the amount of zoom of the scene.

Return

16-length array containing the model-view projection matrix values.

Parameters

intrinsicParameters

intrinsic pinhole camera parameters.

cameraRotation

camera rotation.

cameraCenter

camera center.

width

width of viewport expressed in pixels.

height

height of viewport expressed in pixels.

nearPlane

near plane defining the closest visible vertices.

farPlane

far plane defining the furthest visible vertices.


fun computeModelViewProjectionMatrixAndReturnNew(intrinsicParameters: PinholeCameraIntrinsicParameters, rotationMatrix: Matrix, cameraCenter: Point3D, width: Int, height: Int, nearPlane: Float, farPlane: Float): FloatArray

Computes model-view projection matrix using provided intrinsic pinhole camera parameters, viewport size expressed in pixels, near and far planes and field of view.

The model-view projection matrix is the combination of both the projection and the model-view matrices that OpenGL uses to draw the scene.

The viewport is the surface where the scene is rendered. OpenGL internally normalizes viewport coordinates from -1.0 to 1.0, but the hardware needs to know the actual size of the surface expressed in pixels.

Near and far planes define the region of the 3D space that is actually drawn. Any vertex being at a depth closer to the camera than the near plane, or any vertex being at a depth further from the camera than the far plane, is ignored and not drawn.

The field of view defines how wide is the region of the visible space. It is closely related to the focal length of the pinhole camera intrinsic parameters, and related to the amount of zoom of the scene.

Return

16-length array containing the model-view projection matrix values.

Parameters

intrinsicParameters

intrinsic pinhole camera parameters.

rotationMatrix

3x3 matrix defining camera rotation. This matrix must be orthonormal.

cameraCenter

camera center.

width

width of viewport expressed in pixels.

height

height of viewport expressed in pixels.

nearPlane

near plane defining the closest visible vertices.

farPlane

far plane defining the furthest visible vertices.