diff options
| author | Andrew Guschin <saintruler@gmail.com> | 2020-11-10 01:27:33 +0300 |
|---|---|---|
| committer | Andrew Guschin <saintruler@gmail.com> | 2020-11-10 01:27:33 +0300 |
| commit | aa5790807ad039c1c9db01f7a96f5f643dd56b45 (patch) | |
| tree | 07da8254f9f0ae2e25c4492b1dd98d79db9b9cbc /task05_3D/Guschin/Transform.h | |
| parent | 73c6ec80c71dd43125b6a9b00dd9e940b827f29f (diff) | |
Добавил третье измерение в 5й задаче
Diffstat (limited to 'task05_3D/Guschin/Transform.h')
| -rw-r--r-- | task05_3D/Guschin/Transform.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/task05_3D/Guschin/Transform.h b/task05_3D/Guschin/Transform.h index d606647..474ffb4 100644 --- a/task05_3D/Guschin/Transform.h +++ b/task05_3D/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] = Sy; + return *res; +} + mat3 scale(float S) { return scale(S, S); |