Add an affine_scale command

This commit is contained in:
Arthur Moore 2024-04-29 20:56:56 -04:00
parent a0f7ad83bd
commit dc4069b82d

View file

@ -161,6 +161,18 @@ function affine_translate(vector) = [
[0, 0, 0, 1]
];
/**
* @brief Affine transformation matrix equivalent of `scale`
* @param vector @see `scale`
* @returns An affine transformation matrix for use with `multmatrix()`
*/
function affine_scale(vector) = [
[vector.x, 0, 0, 0],
[0, vector.y, 0, 0],
[0, 0, vector.z, 0],
[0, 0, 0, 1]
];
/**
* @brief Create a rectangle with rounded corners by sweeping a 2d object along a path.
* Centered on origin.