Applies a transform (translation, rotation, scale) to the vector using a Mat4
or numbers. This is the same as multiplying the vector by a matrix. This treats the vector as a point.
self = Vec3:transform(m)
self = Vec3:transform(x, y, z, scale, angle, ax, ay, az)
self = Vec3:transform(translation, scale, rotation)
Arguments Name Type Description m Mat4
The matrix to apply.
Returns Name Type Description self Vec3
The original vector, with transformed components.
Arguments Name Type Default Description x number 0
The x component of the translation.
y number 0
The y component of the translation.
z number 0
The z component of the translation.
scale number 1
The scale factor.
angle number 0
The number of radians to rotate around the rotation axis.
ax number 0
The x component of the axis of rotation.
ay number 1
The y component of the axis of rotation.
az number 0
The z component of the axis of rotation.
Returns Name Type Description self Vec3
The original vector, with transformed components.
Arguments Name Type Default Description translation Vec3
The translation to apply.
scale number 1
The scale factor.
rotation Quat
The rotation to apply.
Returns Name Type Description self Vec3
The original vector, with transformed components.
See also