New WebGL <brick-viewer> web component for MPD files

New WebGL <brick-viewer> web component for MPD files
Hey everyone,

This is my first post here, so hopefully announcements of this sort are ok.

I'm a web developer who works on libraries related to web components, a way for developers to create their own HTML tags. As part of a demo/codelab a coworker and I created a MPD viewer web component using three.js called <brick-viewer>.

<brick-viewer> wraps up three.js and it's LDraw loader example so that it's super easy to use. All you have to do is import the element definition, then use the tag:

PHP Code:
<!-- import the custom element definition -->
script type="module" src=""></script>

<!-- use 
the tag anywhere in HTML -->
brick-viewer src="./radar_truck.mpd"></brick-viewer

You can see a demo here:
And you can install it from npm with:

npm i brick-viewer

<brick-viewer> was made as a demo, but it's pretty usable. It displays build steps with a slider and that's controllable with an HTML attribute. The code itself is pretty straightforward, so it could be extended with new features. You can see the code and file bug reports and feature requests here:

I hope it enables sites like this to easily embed 3D models without any programming. It'd be nice to unleash the potential of WebGL + Lego on the web Smile

I'd love feedback if you try it out! We're new to the file formats and use cases, so if there's something we could do better, let us know.

One thing I'd love to know about is if there are any efforts to make .ldr files be able to link to each other, or newer formats that would allow that. It seems like having to make MPD files slows down the workflow, and makes it a bit harder to make a viewer app that could just render LDR files hosted on the web.

Attached Files
.png   Screen Shot 2020-09-26 at 1.04.11 PM.png (Size: 45.61 KB / Downloads: 31)
« Next Oldest | Next Newest »

Forum Jump:

Users browsing this thread: 1 Guest(s)