参考 mat4()

mat4()

此 API 是实验性的

其行为可能在 p5.js 的未来版本中发生变化。

Creates a 4x4 matrix inside a p5.strands shader callback.

mat4() is the same function as transform3D(), named the way it is in GLSL.

Passing a 3x3 matrix to mat4() extends it with the identity matrix, which turns a 2D transform into a 3D one that leaves the z-axis alone.

Note: mat4() can only be used inside a p5.strands shader callback.

示例

语法

mat4(values1, values2, ..., valuesn)

参数

values1, ..., valuesn
Number: nothing for the identity matrix, one number, one matrix, 4 column vectors, or 16 values in column-major order.

返回值

a 4x4 matrix.

相关参考