From f265d3777d6c601171c7ccc76013c94bc5b13de7 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sat, 27 Sep 2025 14:43:25 +0100 Subject: [PATCH] Add ROT_X and ROT_Z macros --- main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.c b/main.c index b97b41c..e1c1fa4 100644 --- a/main.c +++ b/main.c @@ -46,6 +46,14 @@ static const uint16_t indices[] = { 0, 1, 2, 2, 3, 0 }; x, y, z, 1, \ } +#define ROT_X(a) \ + { \ + 1, 0, 0, 0, \ + 0, cosf(a), sinf(a), 0, \ + 0, -sinf(a), cosf(a), 0, \ + 0, 0, 0, 1, \ + } + #define ROT_Y(a) \ { \ cosf(a), 0, -sinf(a), 0, \ @@ -53,6 +61,14 @@ static const uint16_t indices[] = { 0, 1, 2, 2, 3, 0 }; sinf(a), 0, cosf(a), 0, \ 0, 0, 0, 1, \ } + +#define ROT_Z(a) \ + { \ + cosf(a), sinf(a), 0, 0, \ + -sinf(a), cosf(a), 0, 0, \ + 0, 0, 1, 0, \ + 0, 0, 0, 1, \ + } // clang-format on static void