LDraw Model Viewer and Online Tools - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: General (https://forums.ldraw.org/forum-12.html) +--- Forum: LDraw.org Announcements (https://forums.ldraw.org/forum-1.html) +--- Thread: LDraw Model Viewer and Online Tools (/thread-24106.html) |
LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-01 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. RE: LDraw Model Viewer and Online Tools - Jaco van der Molen - 2020-07-01 (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. 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. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-01 (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. RE: LDraw Model Viewer and Online Tools - Gerald Lasser - 2020-07-01 (2020-07-01, 19:27)Orion Pobursky Wrote: Nothing. Everything is handled in browser and it never leaves your computer. 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 RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-01 (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. RE: LDraw Model Viewer and Online Tools - Lasse Deleuran - 2020-07-01 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. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-01 (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. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-01 (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. RE: LDraw Model Viewer and Online Tools - Lasse Deleuran - 2020-07-02 (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.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. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-09 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. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2020-07-17 (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. 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. RE: LDraw Model Viewer and Online Tools - Jaco van der Molen - 2021-06-03 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? RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2021-06-07 (2021-06-03, 10:52)Jaco van der Molen Wrote: I am trying to submit and view a model that does not load. Sorry for the delay. Can you post or PM the model in question so can test it? RE: LDraw Model Viewer and Online Tools - Jaco van der Molen - 2021-06-08 (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. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2021-06-09 (2021-06-08, 5:45)Jaco van der Molen Wrote: Np 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. RE: LDraw Model Viewer and Online Tools - Jaco van der Molen - 2021-06-09 (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! RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2021-06-11 (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. RE: LDraw Model Viewer and Online Tools - Jaco van der Molen - 2021-06-11 (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 RE: LDraw Model Viewer and Online Tools - Eduard - 2023-10-09 Hey @Orion Pobursky, I would like to use the Viewer for a small university webpage for a lego lab (a lego lab made with school children, only for educational purpose). We have a few own models (as .ldr files, converted from Lego Studio .io) and we would only need a basic simple viewer to show/zoom/rotate the 3D models as a motivation for the kids how the final model looks like. Is there a copyright? Or did you just used the ldraw viewer docs from ThreeJS for building it ? Any code you would like to share (basic functionality around ldraw viewer) ? RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2023-10-10 (2023-10-09, 14:30)Eduard Wrote: Hey @Orion Pobursky, Hi Eduard, We are using buildinginstructions.js (which in turn is using ThreeJS) found here: https://github.com/LasseD/buildinginstructions.js There is some custom code involved but that's just to make things easier on the back end. Lasse's instructions can be used as is. Our code can be found here: https://github.com/ldraw-org/ldraworg-library/blob/main/resources/js/ldbi.js https://github.com/ldraw-org/ldraworg-library/blob/main/resources/js/ldraworgscene.js RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-17 (2021-06-11, 3:01)Orion Pobursky Wrote: I think I've fixed the issue. "File(s)" upload form does not work.Tested in few various browsers, and results are the same for all the cases. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-17 This feature is currently somewhat broken and slated to be moved to the library site. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-18 I've patched it up and the viewer is now here: https://library.ldraw.org/model-viewer I didn't extensively test it so there might be quirks. RE: LDraw Model Viewer and Online Tools - Rene Rechthaler - 2024-10-18 something i noticed: edgelines in inside corners are hard to see... (which then sometimes looks like a missed one) RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-18 (2024-10-18, 10:29)Rene Rechthaler Wrote: something i noticed: edgelines in inside corners are hard to see... This is a known problem with lines in WebGL. I vaguely remember a discussion here on the forums if you want to dig for it. RE: LDraw Model Viewer and Online Tools - Franklin W. Cain - 2024-10-18 When I toggle Photo Mode, I can then see the (red) Technic Half-Pins w/ Friction in the connectors. Thanks, Franklin RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-18 I made a few tweaks to the part fetch routine. Using your model, I'm not seeing the problem you mention. Is it fixed on your end? RE: LDraw Model Viewer and Online Tools - Travis Cobbs - 2024-10-18 (2024-10-18, 16:13)Orion Pobursky Wrote: This is a known problem with lines in WebGL. I vaguely remember a discussion here on the forums if you want to dig for it. Normally a program would polygonOffset to push the solid polygons back in the Z-Buffer a little bit so that when the edge lines are drawn, they don't get hidden like this. (LDView does the equivalent with OpenGL.) I'm not sure if this is compatible with modern WebGL, but I don't see any indication that it isn't. (Note: polygonOffset must push back the solid polygons; it cannot be used to pull the edge lines forward.) RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-18 There are various issues: fully transparent parts, visible hidden edges, Z-fighting in opaque parts, Milky White looks incorrectly in Photo mode, etc. Test MPD-model and screenshots of issues in LeoCAD and LDView are here: RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-18 This is a rendering software issue (transparency can be tricky). Open an issue with buildinginstructions.js: https://github.com/LasseD/buildinginstructions.js/ Edit: I take this back for now as the 3D preview for the tracker doesn't do this. RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-18 (2024-10-18, 21:47)Orion Pobursky Wrote: This is a rendering software issue (transparency can be tricky). As you can see, among other issues, there is an issue that shortcut part is rendered a bit different (and has different glitches) than if stack its subparts manually and place alongside. The same issue has both LeoCAD and LDView: https://forums.ldraw.org/thread-26372-post-55313.html#pid55313 RE: LDraw Model Viewer and Online Tools - Franklin W. Cain - 2024-10-18 (2024-10-18, 19:10)Orion Pobursky Wrote: I made a few tweaks to the part fetch routine. Using your model, I'm not seeing the problem you mention. Is it fixed on your end? Sorry, they still show. :-( FWIW, you are probably using a previous version of my model, where those parts were still color-72, Dark Grey, which is why you won't see this problem. Here is the relevant segment of DAT code, updated: Code: 0 FILE joint.ldr Thanks! Franklin RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-18 I've confirmed that there is a difference between the tracker and the model viewer. Also, FWIW, LDCad renders the boat motor test file with no obvious problems. RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-19 (2024-10-18, 23:19)Orion Pobursky Wrote: Also, FWIW, LDCad renders the boat motor test file with no obvious problems. Confirms, in LDCad all looks good. RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-19 (2024-10-19, 0:52)Eugen Wrote: Confirms, in LDCad all looks good. UPDATE: There is at least one issue in LDCad too. (its not observable with "default" GUI Template, due to background color match in issue zone, but with "dark" GUI Template it clearly visible and diffirentiate shortcut rendering from the same but assembled manually from subparts). RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-19 I went to troubleshoot the above problem. On my work computer I got some similar to the screenshot you posted but I can't replicate on my home computer. Here's the Firefox screenshot: Here's the Chrome screenshot: This leads me to believe this some sort of external graphics issue and beyond my ability to fix. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-19 (2024-10-18, 22:44)Franklin W. Cain Wrote: Sorry, they still show. :-( Your using a mirrored matrix on this line: Code: 1 16 0 0 -10 0.981 0 0.195 -0.195 0 0.981 0 1 0 joint-pt02.ldr RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-19 (2024-10-19, 3:15)Orion Pobursky Wrote: This leads me to believe this some sort of external graphics issue and beyond my ability to fix. You may try to test all the same apps & browsers with sandboxing them from external graphics by forcing to use software OpenGL On Linux: Code: $ env LIBGL_ALWAYS_SOFTWARE=1 <program> On Windows and Mac use appropriate Mesa3D builds and instruction. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-19 It's not worth the trouble since the problem will lie with WebGL render package which I didn't write and don't have the knowledge, skills, or time to try to fix. RE: LDraw Model Viewer and Online Tools - Franklin W. Cain - 2024-10-19 (2024-10-19, 3:32)Orion Pobursky Wrote: You're using a mirrored matrix on this line: Sweet! ^_^ This worked: Code: 1 16 0 0 -10 -0.981 0 0.195 0.195 0 0.981 0 1 0 joint-pt02.ldr Thanks again! ;-) Franklin RE: LDraw Model Viewer and Online Tools - Eugen - 2024-10-19 (2024-10-19, 4:09)Orion Pobursky Wrote: It's not worth the trouble since the problem will lie with WebGL render package which I didn't write and don't have the knowledge, skills, or time to try to fix. OK, lets leave external graphics issues to its software developers. But why there is a difference between shortcut and the manually assembled model from subparts? This difference looks like LDraw-specific issue, as it appears more or less in all the programs and in online viewer too. RE: LDraw Model Viewer and Online Tools - Orion Pobursky - 2024-10-20 (2024-10-19, 4:50)Eugen Wrote: OK, lets leave external graphics issues to its software developers. This is most likely a difference between how a viewer handles a "model" vs a "part" vs a "subpart". I know, for example, that if seams are turned on then LDView shrinks "parts" slightly but not "models". "Subparts" are shrunk with their parent parts. Try turning off seams and see if that changes things in LDView. |