How can I write a loader for three.js?


How can I write a loader for three.js?
#1
hey,
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.
Reply
RE: How can I write a loader for three.js?
#2
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)

EDIT

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.
Reply
RE: How can I write a loader for three.js?
#3
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.

w.
LEGO ergo sum
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)
Forum Jump:


Users browsing this thread: 1 Guest(s)