LDraw Model Viewer and Online Tools


LDraw Model Viewer and Online Tools
#1
A model viewer has been added to the LDraw.org website. This new tool will allow you to upload a model and view it in your browser. It's fairly basic at the moment but functionality will continue to be added.

It can be found in the Tools menu on the LDraw.org main site (click the red brick logo above) or directly here:
https://www.ldraw.org/tools/ldraw-model-viewer.html

This new feature is a continuation of an effort started with the LDCad PBG Generator to bring a series of useful tools to the LDraw.org website. Future plans include an model OMRizer and a part error checker.

As always, feature requests and improvements can be posted in the Website Suggestions forums.
Reply
RE: LDraw Model Viewer and Online Tools
#2
(2020-07-01, 16:22)Orion Pobursky Wrote: A model viewer has been added to the LDraw.org website. This new tool will allow you to upload a model and view it in your browser. It's fairly basic at the moment but functionality will continue to be added.

It can be found in the Tools menu on the LDraw.org main site (click the red brick logo above) or directly here:
https://www.ldraw.org/tools/ldraw-model-viewer.html

This new feature is a continuation of an effort started with the LDCad PBG Generator to bring a series of useful tools to the LDraw.org website. Future plans include an model OMRizer and a part error checker.

As always, feature requests and improvements can be posted in the Website Suggestions forums.

OK, nice! Works quite smoothly.
What happens to the files you submit? Are they kept or temporary and deleted after viewing?
One suggestion if possible would be to adjust the lighting.
Jaco van der Molen
lpub.binarybricks.nl
Reply
RE: LDraw Model Viewer and Online Tools
#3
(2020-07-01, 18:01)Jaco van der Molen Wrote: What happens to the files you submit? Are they kept or temporary and deleted after viewing?

Nothing. Everything is handled in browser and it never leaves your computer.

This may change slightly in the future. For the PT, I send the part number to be displayed to the server and it sends back a list of the parts and primitives used in the file. This helps speed the processing of the file since the viewer doesn't need to ping 2/3/4 separate address to figure out where the part data is (official/unofficial parts/p/textures). For models, the script used will get the model data but it won't be saved anywhere, only used internally by the script.
Reply
RE: LDraw Model Viewer and Online Tools
#4
(2020-07-01, 19:27)Orion Pobursky Wrote: Nothing. Everything is handled in browser and it never leaves your computer.

This may change slightly in the future. For the PT, I send the part number to be displayed to the server and it sends back a list of the parts and primitives used in the file. This helps speed the processing of the file since the viewer doesn't need to ping 2/3/4 separate address to figure out where the part data is (official/unofficial parts/p/textures). For models, the script used will get the model data but it won't be saved anywhere, only used internally by the script.

Really looks nice, and I like the way it is construction the model.

But is it loading unofficial Parts properly? I tried a model using part 24121 (unoff), it did not show this part.


PS: On the main page, the part images don't show
Reply
RE: LDraw Model Viewer and Online Tools
#5
(2020-07-01, 20:30)Gerald Lasser Wrote: But is it loading unofficial Parts properly? I tried a model using part 24121 (unoff), it did not show this part.

It's not scanning for unofficial parts at all right now. That would slow down loading even more. Once I implement the script I mention above, it will.
Reply
RE: LDraw Model Viewer and Online Tools
#7
(2020-07-01, 19:27)Orion Pobursky Wrote: This may change slightly in the future. For the PT, I send the part number to be displayed to the server and it sends back a list of the parts and primitives used in the file. This helps speed the processing of the file since the viewer doesn't need to ping 2/3/4 separate address to figure out where the part data is (official/unofficial parts/p/textures). For models, the script used will get the model data but it won't be saved anywhere, only used internally by the script.

Scratch all this. The way I'm going to implement will not require sending model data to the server. Therefore any model you use will never go anywhere but your browser.
Reply
RE: LDraw Model Viewer and Online Tools
#6
It works really smoothly. Well done. You can get stud logos if you include the texture loading. The default textures are fairly small for performance, but I can generate some that are larger if you think that would be worth the effort.
Reply
RE: LDraw Model Viewer and Online Tools
#8
(2020-07-01, 22:08)Lasse Deleuran Wrote: You can get stud logos if you include the texture loading..

I basically copied your sample code so if that doesn't load textures then the model viewer won't either. 
As for logos, this is the bug I reported. When I do stud logos, the loader want 3-4disc but never actually tries to load it.
Reply
RE: LDraw Model Viewer and Online Tools
#9
(2020-07-01, 22:35)Orion Pobursky Wrote: I basically copied your sample code so if that doesn't load textures then the model viewer won't either. 
As for logos, this is the bug I reported. When I do stud logos, the loader want 3-4disc but never actually tries to load it.
I see. I have fixed the bug so that 3-4disc is loaded using Generator. Or rather. You fixed it in your bug report and I just verified and applied it.
Reply
RE: LDraw Model Viewer and Online Tools
#10
I've updated the model viewer. It now pulls unofficial parts If they're not included in the model. Additionally, I've implemented a part path prefetch (like is used on the PT) to speed up loading. There is a note about how the model data is used at the bottom of the page.
Reply
RE: LDraw Model Viewer and Online Tools
#11
(2020-07-01, 16:22)Orion Pobursky Wrote: A model viewer has been added to the LDraw.org website. This new tool will allow you to upload a model and view it in your browser. It's fairly basic at the moment but functionality will continue to be added.

It can be found in the Tools menu on the LDraw.org main site (click the red brick logo above) or directly here:
https://www.ldraw.org/tools/ldraw-model-viewer.html

This new feature is a continuation of an effort started with the LDCad PBG Generator to bring a series of useful tools to the LDraw.org website. Future plans include an model OMRizer and a part error checker.

As always, feature requests and improvements can be posted in the Website Suggestions forums.

Model viewer has been update to add:
- The ability to change the background color
- The ability to switch between the cell shaded view and the photo render style
- Also added a bunch of under the hood improvements.
Reply
RE: LDraw Model Viewer and Online Tools
#12
I am trying to submit and view a model that does not load.
The process stalls at loading 3-16cyls.dat?
Another model that has kind of the same bricks does load.
At least, I think it also has 3-16cyls.dat in a brick somewhere, because I briefly see it loading.

What could cause this?
Jaco van der Molen
lpub.binarybricks.nl
Reply
RE: LDraw Model Viewer and Online Tools
#13
(2021-06-03, 10:52)Jaco van der Molen Wrote: I am trying to submit and view a model that does not load.
The process stalls at loading 3-16cyls.dat?
Another model that has kind of the same bricks does load.
At least, I think it also has 3-16cyls.dat in a brick somewhere, because I briefly see it loading.

What could cause this?

Sorry for the delay.  Can you post or PM the model  in question so can test it?
Reply
RE: LDraw Model Viewer and Online Tools
#14
(2021-06-07, 23:27)Orion Pobursky Wrote: Sorry for the delay.  Can you post or PM the model  in question so can test it?

Np

I have PMd you.
Jaco van der Molen
lpub.binarybricks.nl
Reply
RE: LDraw Model Viewer and Online Tools
#15
(2021-06-08, 5:45)Jaco van der Molen Wrote: Np

I have PMd you.

This report has uncovered a much deeper bug. Some models load, others don't.  There doesn't seem to be any discernible pattern. Apparently all my test files didn't have whatever problem is causing buildinginstructions.js to crash but figuring out what that is will take some more digging.
Reply
RE: LDraw Model Viewer and Online Tools
#16
(2021-06-09, 15:43)Orion Pobursky Wrote: This report has uncovered a much deeper bug. Some models load, others don't.  There doesn't seem to be any discernible pattern. Apparently all my test files didn't have whatever problem is causing buildinginstructions.js to crash but figuring out what that is will take some more digging.

OK, strange. But good luck bughunting. I'm afraid I cannot help you with that, but if you need any testing done, let me know!
Jaco van der Molen
lpub.binarybricks.nl
Reply
RE: LDraw Model Viewer and Online Tools
#17
(2021-06-09, 18:06)Jaco van der Molen Wrote: OK, strange. But good luck bughunting. I'm afraid I cannot help you with that, but if you need any testing done, let me know!

I think I've fixed the issue. I'm still not sure what the problem was but my fix bypasses all the issues (I think) by totally regenerating the model object. I did find another bug involving changing background color but that doesn't affect the rendering of the model.
Reply
RE: LDraw Model Viewer and Online Tools
#18
(2021-06-11, 3:01)Orion Pobursky Wrote: I think I've fixed the issue. I'm still not sure what the problem was but my fix bypasses all the issues (I think) by totally regenerating the model object. I did find another bug involving changing background color but that doesn't affect the rendering of the model.

Great. I have tested with my model and it works like a charm. Even on my iPhone! Very fast and smooth! TNX
Jaco van der Molen
lpub.binarybricks.nl
Reply
RE: LDraw Model Viewer and Online Tools
#19
Information 
For anyone still interested in LDraw Model Viewer, I've modded this Githb repo (https://github.com/nfriend/ldraw-visualizer) (server component) and packed the sample viewer (https://www.ldraw.org/parts/tools/ldraw-...iewer.html) so as to make it easier to pack a LDR model into a single webpage for viewing.

See sample: here.

Basically, I was trying to figure out how to use the viewer with model fully embedded, so as to easily share virtual Lego models. So the end result is the modded server that can run in command-line mode to generate the parts & primitives list Orion mentioned, for embedding into a webpage along with minified, packed file of viewer scripts. Online server no longer needed in this case.

Info blogged here, mod repo here.

Enjoy Big Grin
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)