Class Geom
- Namespace
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
entityGeomEntityThe geometric entity
matrixMatrix4The transformation matrix
configureFunctionLogger
geom.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
getEntityAABB
Retrieve the Axis-Aligned Bounded Box of a geometric entity
geom.getEntityAABB(entity) -> geom.AABB
Parameters
entityGeomEntityThe 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)
See also:
geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4
Parameters
originPoint3Origin of the new basis
xVector3X axis of the new basis
yVector3Y axis of the new basis
zVector3Z axis of the new basis
Returns
- Matrix4
The change of basis matrix
fromAffine
Create a Matrix from an Affine
See also:
geom.fromAffine(affine) -> geom.Matrix4
Parameters
affineAffineThe affine
Returns
- Matrix4
The created Matrix
fromLookAtMatrix
Get camera position, up and target vectors
See also:
geom.fromLookAtMatrix(matrix, distanceFromTarget) -> geom.Point3, geom.Vector3, geom.Point3
Parameters
Returns
- Point3
The camera position
fromOriginNormal
Create a Matrix from an origin and a normal vector
See also:
geom.fromOriginNormal(origin, normal) -> geom.Matrix4
Parameters
Returns
- Matrix4
The created Matrix
fromTRS
Create a Matrix from translation, rotation and scaling vectors
See also:
geom.fromTRS(T, R, S) -> geom.Matrix4
Parameters
Returns
- Matrix4
The created Matrix
invertMatrix
Invert a matrix
See also:
geom.invertMatrix(matrix) -> geom.Matrix4
Parameters
matrixMatrix4The matrix to invert
Returns
- Matrix4
The inverted matrix
lookAtMatrix
Create a matrix from a camera position, up and target
See also:
geom.lookAtMatrix(position, up, target) -> geom.Matrix4
Parameters
Returns
- Matrix4
The created matrix
multiplyMatrices
Multiply two matrices, returns left*right
See also:
geom.multiplyMatrices(left, right) -> geom.Matrix4
Parameters
Returns
- Matrix4
Result of the matrices multiplication
multiplyMatrixPoint
Multiply a point by a matrix (i.e apply the matrix to a point)
See also:
geom.multiplyMatrixPoint(matrix, point) -> geom.Point3
Parameters
Returns
- Point3
The resulting point
multiplyMatrixVector
Multiply a vector by a matrix (i.e apply the matrix to a vector)
See also:
geom.multiplyMatrixVector(matrix, vector) -> geom.Vector3
Parameters
Returns
- Vector3
The resulting point
orthographicMatrix
Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance
See also:
geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters
width3DDoubleThe 3D width to consider
height3DDoubleThe 3D height to consider
nearClipDistanceDistanceThe near clipping distance
farClipDistanceDistanceThe 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
See also:
geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters
fovXAngleThe field of view on the x axis
aspectRatioDoubleThe aspect ratio foxX/fovY
nearClipDistanceDistanceThe near clipping distance
farClipDistanceDistanceThe far clipping distance
Returns
- Matrix4
The created matrix
toTRS
Decompose a Matrix into translation, rotation and scaling vectors
See also:
geom.toTRS(matrix) -> geom.Vector3List
Parameters
matrixMatrix4The Matrix to be decomposed
Returns
- Vector3List
The TRS list