Ithaca High School Math Seminar Lesson 2-16
Date: 2023.12.20
We've come to the end of the course! With the holiday season nearly here, let's use what we've learned so far to make something reminiscent of the holidays like the star below (click to play).
Goal: Make a 3D Star
If you want to use the same colors as above, I used the default raylib colors rl.GOLD
and rl.YELLOW
(after importing "vendor:raylib"
as rl
).
Some hints: you only need to define four corners and two triangles, and let rotations take care of the rest. Specifically, I defined the north spoke of the star to be
SQRT3 :: 1.73205 P0 :: Vec3{ 0, 1, 0} P1 :: Vec3{-1, 0, ???} P2 :: Vec3{ 1, 0, ???} P3 :: Vec3{ 0, 0, ???} Spoke_Triangles := [2] Triangle{ {P0, P2, P3, rl.GOLD}, {P0, P1, P3, rl.YELLOW}, }
(but with values for ???
you need to figure out) and then drew each triangle six times, after rotation around the y-axis by a multiple of a certain angle. Feel welcome to adapt the code from lesson 2-14 to do this.
Final task: Make a 3D star (or something else) to commemorate the end of the year (and for finishing this course)!