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 bounds

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 target

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 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
Link copied to clipboard
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
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 angle

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 surface

rotate
Link copied to clipboard
fun Matrix44.Companion.rotate(axis: Vector3, angle: Double): Matrix44

Create a rotation matrix around the given axes

rotateX
Link copied to clipboard
fun Matrix44.Companion.rotateX(angle: Double): Matrix44

Create a rotation matrix around the X axes

rotateY
Link copied to clipboard
fun Matrix44.Companion.rotateY(angle: Double): Matrix44

Create a rotation matrix around the Y axes

rotateZ
Link copied to clipboard
fun Matrix44.Companion.rotateZ(angle: Double): Matrix44

Create a rotation matrix around the Z axes

scale
Link copied to clipboard
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
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 vector

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

Create a scaling matrix with the given components

unproject
Link copied to clipboard
fun unproject(point: Vector3, projection: Matrix44, view: Matrix44, width: Int, height: Int): Vector3