LDraw.org Discussion Forums
How can I write a loader for three.js? - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: General (https://forums.ldraw.org/forum-12.html)
+--- Forum: General LDraw.org Discussion (https://forums.ldraw.org/forum-6.html)
+--- Thread: How can I write a loader for three.js? (/thread-22863.html)

How can I write a loader for three.js? - das - 2018-07-08

I'd like to write an Ldraw loader for three.js; Ldraw is a text-based open format for Lego models.

I'm familiar with the format (I've implemented a parser in a different language), but I have trouble understanding the three.js loader architecture.

How is a loader structured? I've tried to go through the source code of existing ones, but I need some starting guidance.

RE: How can I write a loader for three.js? - Lasse Deleuran - 2018-10-04

In order to understand how to structure a loader I found it very useful to study some of the smallest loaders in this library. (Simply check out the code locally and go through the small ones)

With that in hand I started developing my own LDR loaderI am currently working on support for conditional lines and ldconfig.ldr. Having full LDraw-like support in would be a dream come true, but I have a lot of work ahead of me - especially when it comes to optimizing meshes!

The biggest challenge has been to work with multiple files, and structure the code in a way that makes the resulting objects easy and logically structured. The code is currently live on BrickHub.org which is running on the exact same files as the github project (I found the best way to test would be to open it up for others to upload models and find flaws)


The project now has full support for conditional lines and loads ldconfig.ldr for colors. Now it's time to add support for other meta commands, such as LSynth, ghost, buffer exchange, etc.

RE: How can I write a loader for three.js? - Willy Tschager - 2018-10-05

Hi "das" posting from Mumbai,

I deleted the :

Tutuapp 9Apps Latest Version showbox

links to Android Apps at the bottom of your message. Don't try to insert Non-LDraw related content again.