by pantelisk · 6y ago · 0 comments
This is meant to be an experiment of rendering a full 3D scene in html/css. Of course there is a ton of (vanilla) JS to handle pretty much everything - but the main point is to explore what good ol' divs can do in a 3D context.
It might seem a bit off, because I am not a good artist/world builder, but it contains various features such as lights and shadows calculation (rendered on divs though background images + blend modes -- try clicking on the candle). Billboarding and sprite effects, geometry culling etc, as well as scalene triangle computation (which allows us to convert actual 3d models to html elements - https://pantelis.s3-us-west-2.amazonaws.com/0/css3d/readme/t...)
-----
If this interests you, I am giving a presentation on how it is built and lessons learnt this coming Wednesday (2nd of September) at CascadiaJS 2020 ( https://2020.cascadiajs.com/ ), among a line up of awesome speakers!
- Audio on/off switch [y]
- Mouse axis inversion switch [x]
My brain hursts using the mouse to look around that way, I'm too old to learn new tricks!
Great game and proof of concept w/ CSS/HTML, you get 10/10 xD
Love that the layout is responsive and has mobile, tablet and desktop versions in good web UI style. (FYI, if you close the sidebar and resize to desktop, it's missing.)
I also experimented with 3d rendering with just CSS a few years ago. The result came out pretty nice (desktop only I'm afraid): https://www.michaelbromley.co.uk/experiments/css-space-shoot...