From 9666d8fe6c72d0c5836f8752d73e9db947e9d84b Mon Sep 17 00:00:00 2001 From: Chris Lewin Date: Tue, 13 Aug 2024 15:44:10 +0100 Subject: [PATCH] Size canvas according to serialized scene aspect ratio. Add buttons for new scene and creating shapes. Add cookie to remember previous scene selection. --- index.html | 3 +- scenes/boxFracture.json | 158 ++++++++++++++++++++++++ scenes/manifest.json | 6 +- scenes/seedLogo.json | 240 ++++++++++++++++++++++++++++++++++++ scenes/sillyRubber.json | 63 ++++++++++ shaders/g2p2g.wgsl | 3 + shaders/particleRender.wgsl | 2 +- src/gpu.js | 27 ++-- src/main.js | 67 ++++++++-- src/sim.js | 5 +- src/ui.js | 96 +++++++++++++-- 11 files changed, 630 insertions(+), 40 deletions(-) create mode 100644 scenes/boxFracture.json create mode 100644 scenes/seedLogo.json create mode 100644 scenes/sillyRubber.json diff --git a/index.html b/index.html index 51146f4..f364636 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@
- +