Post

mike douges
mike douges@dougesยท
Proof of concept for a #r3f #threejs editor, watch this video with sound on ๐Ÿ”Š! Current mood: It works but it'll be a big effort to make it usable. ๐Ÿงต for how it works ๐Ÿ‘‡
English
6
22
198
0
mike douges
mike douges@dougesยท
The scene-to-source wiring is done by transforming the scenes AST wrapping scene objects in a group with contextual user data. Clicking on a scene object we traverse up the Three.js scene and if this data exists we can do something with it. Only the opened scene is transformed.
mike douges tweet media
English
1
0
5
0
mike douges
mike douges@dougesยท
Surprise! The transformation isn't a bundler plugin but a Deno service that copies source, transforms it using ts-morph and saves it to a temp file. This temp file is then the file imported to the editor! Using ts-morph and the Deno service is important, let's talk about them.
mike douges tweet media
English
1
0
6
0
mike douges
mike douges@dougesยท
ts-morph is great for AST manipulation you can batch 'em up and save when ready. Putting this behind a stateful Deno service and you start seeing something very powerful! In the video on mouse up after moving an entity it calls the update api when saving it calls the save api.
English
1
0
2
0
๊ณต์œ