LDraw.org Discussion Forums

Full Version: WebGL renderer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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:

https://github.com/HazenBabcock/brigl

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

best,
-Hazen

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.
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.

best,
-Hazen
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?
Does it work on either of these sites?
http://www.lugato.net/brigl/index.html
http://hazenbabcock.github.io/brigl/index.html

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.

-Hazen
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.
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?

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

    /media/LDraw_files/Pharaoh's%20Quest/30091/30091%20-%20Desert%20Rover.mpd

    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.
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.

-Hazen
Does Brigl still require all parts in separated directories?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16