3D vierwers: LDraw_to_GLB converter
GLB is the standard 3D format for internet and could even include animations.
Would be creat, converting LeoCAD (LDR) models, into GLB files.
Creating those 3D buildings/structures, will be more appealing, when viewed inside a 3D viewer, so it's time for some coding.
With the help of ChatGPT, managed writing some Python code, converting LDraw geometry into GLB, using the awesome tree.js. This is including textures and limiting file size, so the GLB uses an internal mesh database.
Within WordPress, there are some 3D-Viewer plugins, making it easy to show a model:
Mobaco model 4-73.
L'Edifice model 4-13.
Another way is uploading the model to sketchfab and using an embeded viewer:
Workflow:
- Create custom LeoCAD library (convert: .stl → .dat)
- Create custom building (export to: .ldr)
- Convert LDraw model into GLB (.ldr → .glb)
- Upload model and display on internet.
(Various methods.)
Current status:
- First step converting models, including textures & smart file structure: done.
- Second step: improve creating smaller files size (less polygones, smaller textures): on hold.
(This will requires simplified geometry, so less polygones and lower resolution textures.)

