casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
48 stars 9 forks source link

Add lego subform for mesh #388

Closed KallynGowdy closed 6 months ago

KallynGowdy commented 6 months ago

We should support loading LDraw files to display bots as LEGO models. Three.js already has a loader for it: LDrawLoader.

As far as implementation details, when a bot has #form set to mesh, #subform set to ldraw, and #formAddress set to the URL of a LDraw file, then it should load the file and display the generated mesh as the bot's form. Finally, the #formBuildStep tag should be able to be used to update the building step of the model.

Three.js example: https://threejs.org/examples/?q=lego#webgl_loader_ldraw