Platonic solids, and more...

zaid554

Zaid554

Posted on February 22, 2022

Platonic solids, and more...

You can drag the solid with the mouse or screen touch. Set the speed to 0 if you really want to control its position.

Open holes in the faces to see the hidden side. Close the holes to see actual solids (and improve performance).

Becomes slow (down to 3 fps) on my computer when the number of faces is at its maximum, with holes.

No library, as usual.



A few days ago, I read that the vertices of an icosahedron were on the surface of a cube. This gave me an idea of an easy way to calculate the coordinates of its vertices.

I tried it, and used my perspective projection formulas for a nicer result.

Once this icosahedron was draw, I had the idea to divide its faces into triangles, projecting the intermediate points on the surface of a unity sphere, and iterate this process to get more and more faces.

Then I had the idea this could be done with all Platonic solids. The result is not always as fine as I whished,

Then I added a few features for fun.

💖 💪 🙅 🚩
zaid554
Zaid554

Posted on February 22, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Subgrid
undefined Subgrid

November 29, 2024

#CodePenChallenge: Wall of Text
codepen #CodePenChallenge: Wall of Text

November 29, 2024

Body fluids & circulation Task
codepen Body fluids & circulation Task

November 28, 2024

Flip Card on Hover in CSS
codepen Flip Card on Hover in CSS

November 27, 2024

Backlight in CSS
codepen Backlight in CSS

November 27, 2024