A Star made of 5 intersecting tetrahedra. Use the <arrow> keys and <a> and <z> keys to rotate the star in different directions. * My layering algorithm doesn't quite work! :( It was designed for convex objects which don't have bits that stick out like the points on a star. I draw the 5-sided polygons at the corners of each big triangle face of the tetrahedra but a polygon may be partly in front and partly behind another polygon. I tried splitting the 5-sided polygons into two separate triangles for layering but that didn't fix the problem. At least I finally did the math to find all the intersection points of the 5 tetrahedra and just draw the 5 sided polygons on the outside of the star. There is a help sprite inside showing the 5 sided polygons and calculations for their vertices. The project rotates the 20 tetrahedra vertices in 3D. It then interpolates between these vertices to find all the intersection vertices for the 5-sided polygons. Finding the intersections was the hard math for me.
I challenged myself to make this project for the new "Wish Upon A Star" studio and so shared it despite a difficult layering algorithm problem. This is a Pen project - it doesn't use costumes but draws what you see on the screen. Compound of 5 Tetrahedra: https://en.wikipedia.org/wiki/Compound_of_five_tetrahedra The 20 vertices of a 5 tetrahedra compound are the vertices of the dodecahedron that surrounds it. 3D Tutorial Studio: https://scratch.mit.edu/studios/5040029/ 3D Polyhedrons / Polyhedra Studio: https://scratch.mit.edu/studios/5085215/ My Ray Traced 5 Tetrahedra Compound https://scratch.mit.edu/projects/542258030/ Much faster: https://turbowarp.org/542258030?turbo My Spinning Ray Traced 5 Tetrahedra Compound Only runs fast enough in Turbowarp https://turbowarp.org/542618833?turbo Huge thanks to for his "Faster Triangle Filler" 3D Rotation theory from Wikipedia: https://en.wikipedia.org/wiki/Rotation_matrix