zetaml.documentation [index]


Transformation functions

Functions related to transforming matrix and vector structures.

 Basic transformations

 Projection transformations


zmlMatrix zmlTranslated(zmlMatrix mat, zmlVector vec)

Arguments

Summary

Produces a 4x4 translation matrix from a given matrix mat and the desired 3D vector vec. For an alternative that modifies mat rather than returning a new matrix, see zmlTranslate().

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix(). The vector vec must be of size 3 and the matrix mat must be 4x4.

void zmlTranslate(zmlMatrix *mat, zmlVector vec)

Arguments

Summary

Modifies the given matrix mat so it can be used as a 4x4 translation matrix, using vector vec as the translation factor.

The vector vec must be of size 3 and the matrix mat must be 4x4.

zmlMatrix zmlTranslateIdentity(zmlVector vec)

Arguments

Summary

Produces a 4x4 translation matrix from an identity matrix.

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix(). The vector vec must be of size 3 and the matrix mat must be 4x4.

zmlMatrix zmlRotated(zmlMatrix mat, floating angle, floating x, floating y, floating z)

Arguments

Summary

Produces a 4x4 rotation matrix from a given matrix mat and the desired angle angle. The matrix is rotated based on the given axes (x, y, and z multipliers). For an alternative that modifies mat rather than returning a new matrix, see zmlRotate().

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix(). The vector vec must be of size 3 and the matrix mat must be 4x4.

void zmlRotate(zmlMatrix *mat, floating angle, floating x, floating y, floating z)

Arguments

Summary

Modifies the given matrix mat so it can be used as a 4x4 rotation matrix, using the desired angle angle. The matrix is rotated based on the given axes (x, y, and z multipliers).

The vector vec must be of size 3 and the matrix mat must be 4x4.

zmlMatrix zmlRotateIdentity(floating angle, floating x, floating y, floating z)

Arguments

Summary

Produces a 4x4 rotation matrix from a new identity matrix and the desired angle angle. The matrix is rotated based on the given axes (x, y, and z multipliers).

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix(). The vector vec must be of size 3 and the matrix mat must be 4x4.

zmlMatrix zmlScaled(zmlMatrix mat, zmlVector vec)

Arguments

Summary

Produces a 4x4 scale matrix from a given matrix mat and the desired 3D vector vec. For an alternative that modifies mat rather than returning a new matrix, see zmlScale().

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix(). The vector vec must be of size 3 and the matrix mat must be 4x4.

void zmlScale(zmlMatrix *mat, zmlVector vec)

Arguments

Summary

Modifies the given matrix mat so it can be used as a 4x4 scale matrix, using vector vec as the scale factor.

The vector vec must be of size 3 and the matrix mat must be 4x4.

zmlMatrix zmlScaleIdentity(zmlVector vec)

Arguments

Summary

Produces a 4x4 scale matrix from a new identity matrix and the desired 3D vector vec.

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix(). The vector vec must be of size 3 and the matrix mat must be 4x4.

zmlMatrix zmlConstructOrthoMatrix{LH|RH}(floating lm, floating rm, floating bm, floating tm, floating zn, floating zf)

Arguments

Summary

Allocates and initialises an orthographic projection matrix based on the given values.

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix().

void zmlUpdateOrthoMatrix{LH|RH}(zmlMatrix *mat, floating lm, floating rm, floating bm, floating tm, floating zn, floating zf)

Arguments

Summary

Modifies an existing orthographic matrix based on the given values; an alternative to zmlConstructOrthoMatrix() that doesn't allocate any new memory.


zmlMatrix zmlConstructPerspectiveMatrix{LH|RH}(floating lm, floating rm, floating bm, floating tm, floating zn, floating zf)

Arguments

Summary

Allocates and initialises an perspective projection matrix based on the given values.

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix().

void zmlUpdatePerspectiveMatrix{LH|RH}(zmlMatrix *mat, floating lm, floating rm, floating bm, floating tm, floating zn, floating zf)

Arguments

Summary

Modifies an existing orthographic matrix based on the given values; an alternative to zmlConstructPerspectiveMatrix() that doesn't allocate any new memory.


zmlMatrix zmlConstructLookAtMatrix{LH|RH}(zmlVector pos, zmlVector focus, zmlVector up)

Arguments

Summary

Allocates and initialises a new look-at matrix based on the given values.

This function returns a new heap-allocated matrix, which must be freed after use with a call to zmlFreeMatrix().

void zmlUpdateLookAtMatrix{LH|RH}(zmlMatrix *mat, zmlVector pos, zmlVector focus, zmlVector up)

Arguments

Summary

Modifies an existing look-at matrix based on the given values; an alternative to zmlConstructLookAtMatrix() that doesn't allocate any new memory.