by Theodores · 2y ago · 0 comments
Very.
Backface culling, a lighting model, a little bit of trigonometry, new CSS color model features and much else took more than two minutes. The result does not have true perspective but looks okay-ish.
This experiment and the trifles made me appreciate three.js so much more!
Props to the creator.
Maybe you could have created the pyramid in 3D and rendered it ahead of time to SVG, so you could end up with a perfect perspective projection.
The pyramid also has layers and an initial routine where the layers get added, with a carousel made from details/summary elements to describe the layers. Clicking on the layers opens the respective details/summary and the colour changes.
The shading of the pyramid was particularly hard, since that changes as it rotates. I will have to do that in CSS too...