zmath.math3d

Usefull functions to work in 3d math

Members

Functions

lookAt
M lookAt(V eye, V target, V up)

Look At projection Based on gfm code

orthoMat
M orthoMat(T xMin, U xMax, V yMin, W yMax, X zMin, Y zMax)

Creates a orthographic projection matrix

orthoMat
M orthoMat(T width, U height, V deep)

Creates a orthographic projection matrix

perspectiveMat
M perspectiveMat(T fov, U aspect, V zMin, W zMax)

Creates a projection matrix (similar to gluPerspective)

rotMat
M rotMat(T x, T y, T z, U angle)

Creates a rotation matrix from a axis and angle in radians

rotMat
M rotMat(V v, T angle)

Creates a rotation matrix from a axis and angle in radians

rotMat
M rotMat(Q q)

Creates a rotation matrix from a Quaternion

scaleMat
M scaleMat(T s)

Creates a uniform 3d scale matrix

scaleMat
M scaleMat(T x, T y, T z)

Creates a not uniform 3d scale matrix

scaleMat
M scaleMat(V v)

Creates a not uniform 3d scale matrix

translateMat
M translateMat(V v)

Creates a translation matrix from a 2d/3d Vector

translateMat
M translateMat(T x, T y, T z)

Creates a translation matrix from xyz coords

Templates

is4dMat
template is4dMat(M)

Checks if a type is a valid Matrix for 3d math over 4d

Meta