diff options
| author | Andrew Guschin <saintruler@gmail.com> | 2020-11-28 20:03:11 +0400 |
|---|---|---|
| committer | Andrew Guschin <saintruler@gmail.com> | 2020-11-28 20:03:11 +0400 |
| commit | 10d0d84309702e8d2f826b8c58569be5d710ebf2 (patch) | |
| tree | 63356fcc93b823d5c22f671cf9dcab70d30be2aa /task06/Guschin/Transform.h | |
| parent | 9ac6d0e563ab6409fcb2a42d8ccff0dcf3008904 (diff) | |
Обновил Matrix.h и Transform.h в 6 задаче
Diffstat (limited to 'task06/Guschin/Transform.h')
| -rw-r--r-- | task06/Guschin/Transform.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/task06/Guschin/Transform.h b/task06/Guschin/Transform.h index d606647..d1b0af5 100644 --- a/task06/Guschin/Transform.h +++ b/task06/Guschin/Transform.h @@ -8,6 +8,15 @@ mat3 translate(float Tx, float Ty) return *res; } +mat4 translate(float Tx, float Ty, float Tz) +{ + mat4* res = new mat4(1.f); + (*res)[0][3] = Tx; + (*res)[1][3] = Ty; + (*res)[2][3] = Tz; + return *res; +} + mat3 scale(float Sx, float Sy) { mat3* res = new mat3(1.f); @@ -16,6 +25,15 @@ mat3 scale(float Sx, float Sy) return *res; } +mat4 scale(float Sx, float Sy, float Sz) +{ + mat4* res = new mat4(1.f); + (*res)[0][0] = Sx; + (*res)[1][1] = Sy; + (*res)[2][2] = Sz; + return *res; +} + mat3 scale(float S) { return scale(S, S); |