Vec3:transform

Edit

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.




Arguments

NameTypeDescription
mMat4 The matrix to apply.

Returns

NameTypeDescription
selfVec3 The original vector, with transformed components.

Arguments

NameTypeDefaultDescription
xnumber0 The x component of the translation.
ynumber0 The y component of the translation.
znumber0 The z component of the translation.
scalenumber1 The scale factor.
anglenumber0 The number of radians to rotate around the rotation axis.
axnumber0 The x component of the axis of rotation.
aynumber1 The y component of the axis of rotation.
aznumber0 The z component of the axis of rotation.

Returns

NameTypeDescription
selfVec3 The original vector, with transformed components.

Arguments

NameTypeDefaultDescription
translationVec3 The translation to apply.
scalenumber1 The scale factor.
rotationQuat The rotation to apply.

Returns

NameTypeDescription
selfVec3 The original vector, with transformed components.

See also