LDraw.org Discussion Forums
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)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Re: WebGL renderer - Nicola - 2016-02-23

Hazen Babcock Wrote: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:


Is your brigl project on bitbucket still active? Can I send you a patch with these changes?


Hi, very interesting, expecially the update of three.js. Have you adjusted the smoothing algorithm too? I remember that newer version of Three.js didn't have Quads anymore, and that broke my smoothing algorithm.

I'm not developing brigl anymore, but if i have the time i can try to merge your stuff.

Re: WebGL renderer - Hazen Babcock - 2016-02-24

Yes I did adjust the smoothing algorithm for the lack of quads. It is a little more complicated but it still (seems) to work..
My e-mail address is on my github page if you want to contact me directly.


Re: WebGL renderer - Merlijn Wissink - 2016-02-28

I've tried using your new version on the OMR website and I'm still having the same problem as before your updated version: the log shows it's loading all parts (which I indeed see being downloaded in the browser), then the log shows "Model loaded successfully", but there's just nothing. No model, no error. Just that message.

Mind you: this is on my localhost and not on the 'real' omr server of course, but still... Everything seems to be working, except the actual webgl viewer. Am I just being overlooking something completely obvious?

Re: WebGL renderer - Hazen Babcock - 2016-03-05

Does it work on either of these sites?

Can you send me the file? I can try it to see if it works for me.

Another thing that can be very useful (and maybe you are already aware of?) is that many browsers have "Developer Tools", which you can use to follow exactly what is going on. Most browsers will silently ignore javascript errors, which is fine for general use but can make it very hard to figure out what the issue is when you have a problem like yours. With the developer tools running you can now see any error messages, the console log, etc.


Re: WebGL renderer - Merlijn Wissink - 2016-03-06

Yes, it works perfectly fine on those websites and yes, I know about the development tools. Wink
That's the annoying thing; there are no errors in there...

Here's an example generated webpage (please save the file, I've uploaded it temporarily). Note that I've been moving the javascript files a bit and tried different versions, so that might be a bit messy. It still didn't work though.

Re: WebGL renderer - Hazen Babcock - 2016-03-06

I looked at this doc and my guess is that maybe it is a resizing issue. What is the initial size of the model_container div element? BRIGL won't resize the element, it will just draw it at whatever the current size is. Also, BRIGL doesn't handle resize events so the element has to already have the correct final size before rendering.

Is there a publicly accessible version somewhere that I could try and load in my browser?


Re: WebGL renderer - Merlijn Wissink - 2016-03-06

Oh my god, you're right! I completely missed the fact that the div element needs to be set at a certain size manually. I was expecting Brigl to... just put the viewer in there. Well, not really expectingin, I didn't even think about either way. Actually, now I think of it, it's quite logical that it doesn't set its own size (I mean, it doesn't know what size it should be).

Maybe you can include it in the HOWTO.txt?

Ah well, it's working now. Thanks a lot! Smile

Re: WebGL renderer - Merlijn Wissink - 2016-03-06

I'd like to include this in the omr website. However, I have 2 feature requests that would make it a little better for the omr site:
  • The LDraw files are saved with their 'OMR filename'. That means that sometimes, the loadByUrl receives a url like this:


    It doesn't have any problems with the %20, but the ' (which is transformed into 'Wink seems to be a problem.
    That doesn't work. Is it possible to add support for those links?
  • It would be nice if Brigl would detect a large model (e.g. models with more than 1500 parts) and if it detects one, it doesn't load the model without the user's 'permission' (e.g. a button).

Those are 2 things I can think of at the moment to make it more suitable for the OMR.

Re: WebGL renderer - Hazen Babcock - 2016-03-06

It is good to hear that it is working now.

Thank you for the suggestion, I added a note to HOWTO.txt and a warning message to BriglContainer.


Re: WebGL renderer - Orion Pobursky - 2016-03-06

Does Brigl still require all parts in separated directories?