Package org.openrndr.math.transforms

Types

TransformBuilder
Link copied to clipboard
class TransformBuilder(baseTransform: Matrix44)

Functions

buildTransform
Link copied to clipboard
fun buildTransform(baseTransform: Matrix44 = Matrix44.IDENTITY, builder: TransformBuilder.() -> Unit): Matrix44
An alias for transform, useful for those cases in which the word transform is used too often
frustum
Link copied to clipboard
fun frustum(left: Double, right: Double, bottom: Double, top: Double, zNear: Double, zFar: Double): Matrix44
Creates frustum matrix with the given boundsleft Left bound of the frustum right Right bound of the frustum bottom Bottom bound of the frustum top Top bound of the frustum zNear Near bound of the frustum zFar Far bound of the frustum
lookAt
Link copied to clipboard
fun lookAt(eye: Vector3, target: Vector3, up: Vector3 = Vector3.UNIT_Y): Matrix44
Create a view matrix from a camera at position eye look at targeteye the position of the camera target the target the camera looks at up direction of up, default direction is Vector3.
normalMatrix
Link copied to clipboard
fun normalMatrix(view: Matrix44): Matrix44
Construct a normal matrix from the give view matrix
ortho
Link copied to clipboard
fun ortho(xMag: Double, yMag: Double, zNear: Double, zFar: Double): Matrix44
Creates an orthographic projection matrixxMag The horizontal magnification of the view yMag The vertical magnification of the view zNear The distance to the near clipping plane zFar The distance to the far clipping plane
fun ortho(left: Double, right: Double, bottom: Double, top: Double, zNear: Double, zFar: Double): Matrix44
Creates an orthographic projection matrix with the given boundsleft left plane of the clipping volume right right plane of the clipping volume bottom bottom plane of the clipping volume top top plane of the clipping volume zNear The distance to the near clipping plane zFar The distance to the far clipping plane
perspective
Link copied to clipboard
fun perspective(fovY: Double, aspectRatio: Double, zNear: Double): Matrix44
Creates an perspective projection matrix with infinite clipping depthFor more on projection matrices please visit http://learnwebgl.brown37.net/08_projections/projections_perspective.
fun perspective(fovY: Double, aspectRatio: Double, zNear: Double, zFar: Double): Matrix44
Creates an perspective projection matrixFor more on projection matrices please visit http://learnwebgl.brown37.net/08_projections/projections_perspective.
fun perspective(fovY: Double, aspectRatio: Double, zNear: Double, zFar: Double, xOffset: Double, yOffset: Double): Matrix44
Creates an perspective projection matrix with a shifted apexFor more on projection matrices please visit http://learnwebgl.brown37.net/08_projections/projections_perspective.
perspectiveHorizontal
Link copied to clipboard
fun perspectiveHorizontal(fovY: Double, aspectRatio: Double, zNear: Double, zFar: Double, xOffset: Double, yOffset: Double): Matrix44
Creates an perspective projection matrix locking the horizontal view anglefovY Y field of view in degrees aspectRatio lens aspect ratio zNear The distance to the near clipping plane along the -Z axis.
project
Link copied to clipboard
fun project(point: Vector3, projection: Matrix44, view: Matrix44, width: Int, height: Int): Vector3
Project a 3D point on a 2D surfacepoint the point to project projection the projection matrix view the view matrix width the width of the projection surface height the height of the projection surface
rotate
Link copied to clipboard
fun Matrix44.Companion.rotate(axis: Vector3, angle: Double): Matrix44
Create a rotation matrix around the given axesaxis the axis to rotate around angle the angle in degrees
rotateX
Link copied to clipboard
fun Matrix44.Companion.rotateX(angle: Double): Matrix44
Create a rotation matrix around the X axesangle the angle in degrees
rotateY
Link copied to clipboard
fun Matrix44.Companion.rotateY(angle: Double): Matrix44
Create a rotation matrix around the Y axesangle the angle in degrees
rotateZ
Link copied to clipboard
fun Matrix44.Companion.rotateZ(angle: Double): Matrix44
Create a rotation matrix around the Z axesangle the angle in degrees
scale
Link copied to clipboard
fun Matrix44.Companion.scale(scaleFactor: Vector3): Matrix44
Create a scaling matrix with the given vectorscale scale vector
fun Matrix44.Companion.scale(x: Double, y: Double, z: Double): Matrix44
Create a scaling matrix with the given componentsx direction scale factor y direction scale factor z direction scale factor
transform
Link copied to clipboard
fun KMutableProperty0<Matrix44>.transform(builder: TransformBuilder.() -> Unit)
Matrix44 property transform helper
@JvmName(name = matrix44Transform)
fun Matrix44.transform(builder: TransformBuilder.() -> Unit): Matrix44
Matrix44 transform helper
fun transform(baseTransform: Matrix44 = Matrix44.IDENTITY, builder: TransformBuilder.() -> Unit): Matrix44
Build a transform presented by a Matrix44
translate
Link copied to clipboard
fun Matrix44.Companion.translate(translation: Vector3): Matrix44
Create a translate matrix with the given vectorscale scale vector
fun Matrix44.Companion.translate(x: Double, y: Double, z: Double): Matrix44
Create a scaling matrix with the given componentsx translate direction y translate direction z translate direction
unproject
Link copied to clipboard
fun unproject(point: Vector3, projection: Matrix44, view: Matrix44, width: Int, height: Int): Vector3