diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-12 14:14:06 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-12 14:14:06 +0200 |
| commit | 7b214503608550dc2853b9e01526723f8c65baf3 (patch) | |
| tree | ddbc37eb2627b43eb33774bd2bf205336cd1a9e6 /vendor/libftm/src/mat4/ftm_mat4scale.c | |
| parent | d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34 (diff) | |
| download | scop-7b214503608550dc2853b9e01526723f8c65baf3.tar.gz scop-7b214503608550dc2853b9e01526723f8c65baf3.tar.bz2 scop-7b214503608550dc2853b9e01526723f8c65baf3.zip | |
Added mat4 in libftm, can rotate, scale and translate vector
Diffstat (limited to 'vendor/libftm/src/mat4/ftm_mat4scale.c')
| -rw-r--r-- | vendor/libftm/src/mat4/ftm_mat4scale.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/libftm/src/mat4/ftm_mat4scale.c b/vendor/libftm/src/mat4/ftm_mat4scale.c new file mode 100644 index 0000000..a278c83 --- /dev/null +++ b/vendor/libftm/src/mat4/ftm_mat4scale.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ftm_mat4scale.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/05/12 11:16:19 by charles #+# #+# */ +/* Updated: 2020/05/12 11:18:38 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libftm_mat4.h" + +t_ftmmat4 *ftm_mat4scale(t_ftmmat4 *mat4, float x, float y, float z) +{ + t_ftmmat4 scale; + + ftm_mat4init_eye(&scale, 1.0); + ftm_mat4set(&scale, 0, 0, x); + ftm_mat4set(&scale, 1, 1, y); + ftm_mat4set(&scale, 2, 2, z); + ftm_mat4mul(mat4, &scale); + return (mat4); +} |
