WebGL renderer - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html) +--- Thread: WebGL renderer (/thread-6835.html) |
Also trying LDraw in WebGL - Daniel B - 2012-12-28 Very impressed with what you've got there. Recently thought i'd give WebGL a go my self. Mainly to replace the ancient LDraw cad software i made about 8 years ago: http://news.lugnet.com/cad/?n=11299 It's still available from that link if your interested. Looks like your about two months ahead of me in dev. I have models loading and showing with nice normal's etc but it's all server side gen. Will let you know when i get mine up on a server. Re: Also trying LDraw in WebGL - Daniel B - 2012-12-28 Much rougher than yours atm. But here is my WebGL LDraw project. The parts list on my server is a cut down one, so most models won't work yet. http://mr-bucket.co.uk/TestWebGL.aspx Re: WebGL renderer - Michael Horvath - 2012-12-31 I would like to use this on my website. Can't wait!! Re: WebGL renderer - Michael Heidemann - 2013-01-01 I just tested again with the same file, but unfortunately it still does not work If I can be of any help please let me know. Re: WebGL renderer - Nicola - 2013-01-15 yeah i still havn't solved the bug.. i'll look into it asap Re: Also trying LDraw in WebGL - Nicola - 2013-01-15 Daniel B Wrote:Much rougher than yours atm. But here is my WebGL LDraw project. That's great An online editing tool would be nice! Re: WebGL renderer - Nicola - 2013-01-15 Thanks Well if you want to use it you can do that already. All sources are up and installing should be straightforward but if you need help just ask. I'm already using it in a project of mine Re: WebGL renderer - Michael Heidemann - 2013-01-15 I had also an eye on that, but for me it was not "straight forward" so I pushed it away that day. Maybe you can write some lines how to make it work. maybe I am tooooo stupid. Re: WebGL renderer - Nicola - 2013-01-15 ok i verified the problem. There's a line that breaks everything: 1 117313504 -125 -208 -400 0 0 1 0 1 0 -1 0 0 3941.DAT The color number is clearly off and javascript chokes. Replacing with the following will work. 1 14 -125 -208 -400 0 0 1 0 1 0 -1 0 0 3941.DAT Note that the other problem is still there. Also i noticed that the file use spaces in internal file names, i think brigl don't like that either. I've attached the cleaned file. Here's how it render: Re: WebGL renderer - Roland Melkert - 2013-01-15 The colour number is not off, it's an custom one. See also this recent thread: http://forums.ldraw.org/showthread.php?tid=7660&pid=7660#pid7660 Re: WebGL renderer - Nicola - 2013-01-16 ohh thanks! that was the same model too. i think i'll pass this one Re: WebGL renderer - Michael Heidemann - 2013-01-16 Thanks for the update. Regarding filenames with spaces I found no limitation in our specs that they are not allowed. Even more in the spec for OMR the delimiter for set number and set description is " - " (whitespace, dash, whitespace). So your parser *needs* to support whitespace in filenames. I am sure you will find a solution Re: WebGL renderer - Nicola - 2013-01-16 yes it currently support single space separators but nothing else (no double spaces etc) it needs to be fixed Re: WebGL renderer - Michael Horvath - 2013-01-25 Yes, some instructions would be nice, as well as a zip file with everything we need in it. Re: WebGL renderer - Nicola - 2013-01-28 Michael Horvath Wrote:Yes, some instructions would be nice, as well as a zip file with everything we need in it. Ok, i'll write something. The hardest part is preparing the part library: pieces must be spread in different folders becouse servers tipically don't like 7000+ files in a single folder (btw this is something LDraw could consider too, that is not a good thing in general). I'll write a little utility to do that. Re: WebGL renderer - Roland Melkert - 2013-01-28 This can be fixed using an alternative filesystem or different formatting parameters for ext3/4 Re: WebGL renderer - Michael Heidemann - 2013-01-28 For Fat32 see here for the limits: http://help.lockergnome.com/windows2/file-folder-limits--ftopict450749.html For NTFS see here for the limits: http://superuser.com/questions/446282/max-files-per-directory-on-ntfs-vol-vs-fat32 And some thoughts on ext3 here: http://serverfault.com/questions/129953/maximum-number-of-files-in-one-ext3-directory-while-still-getting-acceptable-per Re: WebGL renderer - Steffen - 2013-01-28 i think this is something we should leave to the underlying filesystem: from the perspective of the ldraw library, "parts" are in a, or better, in one "folder". if this number of files is big and the filesystem internally wants to spread this, it can do. outside, to the user, it should still be a single folder. i do not want to search multiple folders for parts, and i especially don't want to do this different on different os' es... Re: WebGL renderer - Travis Cobbs - 2013-01-28 While I'm not advocating splitting things up, it's definitely not up to the file system. The whole stated problem is that some file systems have problems when there are a large number of files in one directory. To be honest, I don't think the 6000+ files we have now is causing problems, but the file system can't internally spread them out, because that would redefine the meaning of a directory. As for searching, do you do your searches against the actual files on the disk, or using tools based on LDraw? Any change to the folder structure would require updating all tools to support the change, which is why I don't think it will ever (or even should ever) happen. But since the tools would have to be updated anyway, a change in the underlying structure wouldn't change the user experience for people using the tools. Re: WebGL renderer - Rolf Osterthun - 2013-08-21 Hey Nicola, your Brigl renderer is really awesome. I gave it a try and it works great for my concerns. I hope it is still ok for you if I use it on a webpage (e.g. http://www.digital-bricks.de/en/index.php?site=flp)? Thanks for sharing. Rolf Re: WebGL renderer - Nicola - 2013-08-21 Of course it is, that's why i made it Re: WebGL renderer - Willy Tschager - 2013-08-30 Question is: Is there a way to use it here on the forums in some ways? For example generating pics of models or parts people just submit as .ldr or .dat and a pic of the content is added to the post? w. Re: WebGL renderer - Nicola - 2013-08-30 Yes, that shouldn't be hard. What you need to run it is loading the part library to some folder on the same origin as the page running it. I think Ldraw should already have it avaiable. The rest is standard javascript fiddling (include JS files, add some snippet of code, etc). Here's a more detailed howto. You can take a look at the simplest example here. Rebrickable is also using brigl on their part detail page. Re: WebGL renderer - Steffen - 2013-08-30 WOW; that would be AWESOME... EVEN the parts tracker could show the PARTS this way... imagine a 3D object there, interacting with your mouse... Re: WebGL renderer - Rolf Osterthun - 2013-09-12 Hey Nicola, indeed, the LDraw site should have the complete library online (can somebody confirm that?). I think the biggest challange is, that your renderer needs the complete library in a special folder structure (one folder or your suggested subfolder structure). I have almost no skills in JavaScript, but I had a closer look into your code, tried some changes and used copy and past to generate the following code snippet (the paths are hardcoded): Code: asyncReq: function(partName, callback) Due to my missing knowledge of JavaSkript, I have no idea if my code causes deadlocks or dead threads or ... whatever. But it seems to work with the standart folder structure: http://www.digital-bricks.de/en/index.php?site=3d&part=3005 I would really like to see your Brigl renderer used at the parts tracker and / or in this forum. Rolf Re: WebGL renderer - Orion Pobursky - 2013-09-12 This is in the works. I just want to make sure it "fails gracefully" on unsupported browsers/hardware Re: WebGL renderer - Steffen - 2013-09-14 YAY! hurray! Re: WebGL renderer - Orion Pobursky - 2013-09-18 I'm having trouble implementing the viewer. Everything seems to be working fine. The log messages are displaying but the viewer doesn't appear. I think this might be a file path issue. I'm using: Code: var builder = new BRIGL.Builder("parts/",{dontUseSubfolders:true}); What should the library path I pass to the viewer be relative to? The html file containing the viewer code? Absolute for the webserver? Re: WebGL renderer - Rolf Osterthun - 2013-09-19 Hey Orion, for the digital-bricks.de website, I use the following line: Code: var builder = new BRIGL.Builder("../parts/", {dontUseSubfolders:"true"}); I use the relative path from the html file containing the viewer code. When your parts folder and this file are in the same folder you may try "./parts/". Rolf Re: WebGL renderer - Orion Pobursky - 2013-09-19 Ok. It was a path and permissions problem with my local server. Hopefully I fixed it and can have this up soon on the forums. Re: WebGL renderer - Orion Pobursky - 2013-09-19 Still getting a 403 forbidden error code even though I've set the parts directory to global read/write. Any ideas? Re: WebGL renderer - Orion Pobursky - 2013-09-19 This is totally on my end and in no way related to the brigl software. I'l have to troubleshoot some more. Re: WebGL renderer - Orion Pobursky - 2013-09-19 Ok, I've worked out the bugs. Now clean up the viewport code and implement fallback code. Re: WebGL renderer - Nicola - 2013-11-19 Orion Pobursky Wrote:Ok, I've worked out the bugs. Now clean up the viewport code and implement fallback code. Hello there! Sorry, for some reasons i didn't received notifications and missed these new posts! Let me know if you still need help with it. I'm planning to resume working on brigl soon and finally get the smoothing right and upgrading to the last version of Three.js Re: WebGL renderer - Steffen - 2013-11-21 I am still dreaming of seeing brigl being used for the parts display on the Parts Tracker and of files posted here in the forum... that'll just be *awesome* Re: WebGL renderer - Orion Pobursky - 2013-11-21 As usually happens when I'm near in completion of a project, real life got in the way. Hopefully I'll have some free time during the holidays to finish up the half a dozen little LDraw items I've been working on. Re: WebGL renderer - Steffen - 2013-11-23 Re: WebGL renderer - Lucas GIRARD - 2014-03-08 Hi everybody, I have download all sources and parts, upload them on my server. Implement the viewer, but nothing appear !!!! http://www.brickmarket.fr/gui/webGL3D/web/simple2.html I just try to see the part 3005.dat. Model loaded successfully Generating geometry Loading 4-4disc.dat Loading 4-4cyli.dat Loading 4-4edge.dat Loading stud.dat Loading box5.dat Loading ../parts/3005.dat Creating ../parts/3005.dat... Initializing... Could you help me ? Re: WebGL renderer - Willy Tschager - 2014-11-13 I still wonder if this is doable - Orion? w. Re: WebGL renderer - Steffen - 2014-11-14 +1 if BrickSet can do it, then why shouldn't we be using it in the forums and the PT? Re: WebGL renderer - Michael Horvath - 2014-11-30 I have no control over the file system. I just rent space from a web hosting company. Re: WebGL renderer - Nathanel Titane - 2014-12-06 Hey there Nicola, Been playing around with Brigl and must say I love it. Is there any way to revise or enable LDraw's standard parts directory listing instead of the parsing your JS proposes or the no subdir option (which forces everything into a single directory)? Thank you. Re: WebGL renderer - Rolf Osterthun - 2014-12-06 Nathanel Titane Wrote:Is there any way to revise or enable LDraw's standard parts directory listing instead of the parsing your JS proposes or the no subdir option (which forces everything into a single directory)? Hey Nathanel, it is some time ago now, but I once wrote this post. I think this is exactly what you are looking for? Rolf Re: WebGL renderer - Nathanel Titane - 2014-12-06 Hey Rolf, thanks for posting the reply - where would I append the code to enable it? I am litterally |-----| << this close to getting it to work on my blog Re: WebGL renderer - Nathanel Titane - 2014-12-06 brigl does not seem to support the mpd file format... is there any way to have it parse it properly? Re: WebGL renderer - Nathanel Titane - 2014-12-06 Rolf, I fixed the hardcoding: asyncReq: function(partName, callback) { var purl = this.partsUrl + partName; purl = purl.replace(/\\/gi, "/"); this.asyncnum++; new Ajax.Request(purl, { method: 'get', onSuccess: (function(transport) { var res = transport.responseText; this.asyncnum--; callback(res); }).bind(this), onFailure: (function() { purl = this.partsUrl + /p/ + partName; new Ajax.Request(purl, { method: 'get', onSuccess: (function(transport) { var res = transport.responseText; this.asyncnum--; callback(res); }).bind(this), onFailure: (function() { this.asyncnum--; alert('Something went wrong loading: ' + purl); }).bind(this) }); }).bind(this) }); }, Re: WebGL renderer - Nathanel Titane - 2014-12-06 Nicola, any way to add touch event listenenrs to brigl? Re: WebGL renderer - Nathanel Titane - 2014-12-07 Well, my friends, here is what I've got so far: http://nathaneltitane.blogspot.ca/p/test_6.html Re: WebGL renderer - Nicola - 2014-12-15 Nathanel Titane Wrote:Hey there Nicola, Thanks the nosubdir option actually use the standard part directory listing, it is not that it require a single flat directory. Just use the option and plug your library as is, it should work. Nathanel Titane Wrote:Nicola, any way to add touch event listenenrs to brigl? Actually that is Threejs stuff. Brigl basically create a Threejs object, and then you can do whatever you want with it. I included the BriglContainer code that will create a very basic Threejs scene, but that's just for convenience. Brigl already support mouse event, so i guess you need touch events such as from tablets or smartphones? Let me know if you need more help Re: WebGL renderer - Hazen Babcock - 2016-02-23 Hello Nicola, I've been hacking on this a bit as I was interested in something that would work on a tablet. I've added touch event handling (one finger to rotate, two to zoom / translate). I've also updated it to use three.js r74, tried to improve the centering and some other minor changes. If you are interested, my work is here: https://github.com/HazenBabcock/brigl Is your brigl project on bitbucket still active? Can I send you a patch with these changes? best, -Hazen |