LDraw.org Discussion Forums

Full Version: How can I write a loader for three.js?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
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.