On this page

Function fromRotationTranslationScaleOrigin

  • Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin This is equivalent to (but much faster than):

    mat4.identity(dest);
    mat4.translate(dest, dest, vec);
    mat4.translate(dest, dest, origin);
    let quatMat = mat4.create();
    mat4.fromQuat(quatMat, quat);
    mat4.multiply(dest, dest, quatMat);
    mat4.scale(dest, dest, scale)
    mat4.translate(dest, dest, negativeOrigin);
    

    Parameters

    Returns mat4

    out

Was this helpful?
SDK JS
Reference
fromRotationTranslationScaleOrigin