meta data for this page

Matrix Transform

The previous transforms are actually simplified versions of matrix mathematics. For example, translate is just applying addition using a matrix.

Learn about matrix mathematics at

let matrix = mat4.create()
matrix = mat4.multiply(mat4.rotationX(40))
matrix = mat4.multiply(mat4.rotationZ(40))
matrix = mat4.multiply(mat4.translation([-.5, 0, 0]))
matrix = mat4.multiply(mat4.scaling([1.1, 1.2, 1.3]))
// and apply the transform
const myshape = transform(matrix, cube())