Table of Contents

Class Geom

Namespace
Geom

Methods

applyTransform

Apply a transformation matrix to a geometrical entity

geom.applyTransform(entity, matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])

Parameters

entity GeomEntity

The geometric entity

matrix Matrix4

The transformation matrix

configureFunctionLogger

geom.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)

Parameters

functionName String
enableFunction Boolean
enableParameters Boolean
enableExecutionTime Boolean

getEntityAABB

Retrieve the Axis-Aligned Bounded Box of a geometric entity

geom.getEntityAABB(entity) -> geom.AABB

Parameters

entity GeomEntity

The geometric entity

Returns

AABB

The axis aligned bounded box

changeOfBasisMatrix

Construct a Change of Basis Matrix (e.g multiplying the point [0,0,0] will result to the point origin)

geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4

Parameters

origin Point3

Origin of the new basis

x Vector3

X axis of the new basis

y Vector3

Y axis of the new basis

z Vector3

Z axis of the new basis

Returns

Matrix4

The change of basis matrix

fromLookAtMatrix

Get camera position, up and target vectors

geom.fromLookAtMatrix(matrix, distanceFromTarget) -> geom.Point3, geom.Vector3, geom.Point3

Parameters

matrix Matrix4

The created Matrix

distanceFromTarget Distance

Returns

Point3

The camera position

fromOriginNormal

Create a Matrix from an origin and a normal vector

geom.fromOriginNormal(origin, normal) -> geom.Matrix4

Parameters

origin Point3

The origin point

normal Vector3

The normal vector

Returns

Matrix4

The created Matrix

fromTRS

Create a Matrix from translation, rotation and scaling vectors

geom.fromTRS(T, R, S) -> geom.Matrix4

Parameters

T Vector3

The translation vector

R Vector3

The rotations vector

S Vector3

The scaling vector

Returns

Matrix4

The created Matrix

invertMatrix

Invert a matrix

geom.invertMatrix(matrix) -> geom.Matrix4

Parameters

matrix Matrix4

The matrix to invert

Returns

Matrix4

The inverted matrix

lookAtMatrix

Create a matrix from a camera position, up and target

geom.lookAtMatrix(position, up, target) -> geom.Matrix4

Parameters

position Point3

The camera position

up Vector3

The up vector

target Point3

The target position

Returns

Matrix4

The created matrix

multiplyMatrices

Multiply two matrices, returns left*right

geom.multiplyMatrices(left, right) -> geom.Matrix4

Parameters

left Matrix4

Left side matrix

right Matrix4

Right side matrix

Returns

Matrix4

Result of the matrices multiplication

multiplyMatrixPoint

Multiply a point by a matrix (i.e apply the matrix to a point)

geom.multiplyMatrixPoint(matrix, point) -> geom.Point3

Parameters

matrix Matrix4

The matrix to apply

point Point3

The point to multiply

Returns

Point3

The resulting point

multiplyMatrixVector

Multiply a vector by a matrix (i.e apply the matrix to a vector)

geom.multiplyMatrixVector(matrix, vector) -> geom.Vector3

Parameters

matrix Matrix4

The matrix to apply

vector Vector3

The vector to multiply

Returns

Vector3

The resulting point

orthographicMatrix

Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance

geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4

Parameters

width3D Double

The 3D width to consider

height3D Double

The 3D height to consider

nearClipDistance Distance

The near clipping distance

farClipDistance Distance

The far clipping distance

Returns

Matrix4

The created matrix

perspectiveMatrix

Create a perspective matrix from a fovX, an aspect ratio, a near, and a far clipping distance

geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4

Parameters

fovX Angle

The field of view on the x axis

aspectRatio Double

The aspect ratio foxX/fovY

nearClipDistance Distance

The near clipping distance

farClipDistance Distance

The far clipping distance

Returns

Matrix4

The created matrix

toTRS

Decompose a Matrix into translation, rotation and scaling vectors

geom.toTRS(matrix) -> geom.Vector3List

Parameters

matrix Matrix4

The Matrix to be decomposed

Returns

Vector3List

The TRS list