# Packageorg.openrndr.math.transforms

## Types

TransformBuilder
class TransformBuilder(baseTransform: Matrix44)

## Functions

buildTransform
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
fun frustum(left: Double, right: Double, bottom: Double, top: Double, zNear: Double, zFar: Double): Matrix44

Creates frustum matrix with the given bounds

lookAt
fun lookAt(eye: Vector3, target: Vector3, up: Vector3 = Vector3.UNIT_Y): Matrix44

Create a view matrix from a camera at position eye look at target

normalMatrix
fun normalMatrix(view: Matrix44): Matrix44

Construct a normal matrix from the give view matrix

ortho
fun ortho(xMag: Double, yMag: Double, zNear: Double, zFar: Double): Matrix44

Creates an orthographic projection matrix

fun ortho(left: Double, right: Double, bottom: Double, top: Double, zNear: Double, zFar: Double): Matrix44

Creates an orthographic projection matrix with the given bounds

perspective
fun perspective(fovY: Double, aspectRatio: Double, zNear: Double): Matrix44

Creates an perspective projection matrix with infinite clipping depth

fun perspective(fovY: Double, aspectRatio: Double, zNear: Double, zFar: Double): Matrix44

Creates an perspective projection matrix

fun perspective(fovY: Double, aspectRatio: Double, zNear: Double, zFar: Double, xOffset: Double, yOffset: Double): Matrix44

Creates an perspective projection matrix with a shifted apex

perspectiveHorizontal
fun perspectiveHorizontal(fovY: Double, aspectRatio: Double, zNear: Double, zFar: Double, xOffset: Double, yOffset: Double): Matrix44

Creates an perspective projection matrix locking the horizontal view angle

project
fun project(point: Vector3, projection: Matrix44, view: Matrix44, width: Int, height: Int): Vector3

Project a 3D point on a 2D surface

rotate
fun Matrix44.Companion.rotate(axis: Vector3, angle: Double): Matrix44

Create a rotation matrix around the given axes

rotateX
fun Matrix44.Companion.rotateX(angle: Double): Matrix44

Create a rotation matrix around the X axes

rotateY
fun Matrix44.Companion.rotateY(angle: Double): Matrix44

Create a rotation matrix around the Y axes

rotateZ
fun Matrix44.Companion.rotateZ(angle: Double): Matrix44

Create a rotation matrix around the Z axes

scale
fun Matrix44.Companion.scale(scaleFactor: Vector3): Matrix44

Create a scaling matrix with the given vector

fun Matrix44.Companion.scale(x: Double, y: Double, z: Double): Matrix44

Create a scaling matrix with the given components

transform
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