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
I have the same problem as Willy. Could be an issue with / vs. \ in pathes?
is most surely is. you're probably using firefox, right? chrome does slash substitution but firefox not.

it's fixed now, can you retry?
Steffen Wrote:the improvements which I spontaneously like to collect here, jumping to my eye or mind, are

(a) rotation center:
The center of rotation currently seems to be hardcoded 0/0/0.
I would better like to have it at the model's center, like in LDView.
Using the mouse currently in your web app feels so different than LDView,
that it confuses me. I would love to see a big similarity in mouse handling between the 2 tools.

Yes that's hardcoded now. I don't know if ldview calculates the center automatically or uses some metadata in the file. i have to make some tests.
About the mouse, i just thrown in a working system, it surely can be improved, and it needs zooming with the wheel Smile

Steffen Wrote:(b) incremental parts display:
perhaps it is very easy to do, and you could show the model already while it is loading.
the user can watch the downloaded parts appear in the model.
I think it could be quite cheap to do, because you already know all the matrices etc, just the "real" part data is missing.
Thus, you could already build up the necessary data structures, and skip them on rendering, while the model is not fully loaded.
I think this would be an evern more "incremental" load than displaying the progress status message Big Grin

Yeah i considered it too.. Seeing the model progressively being built would be awesome. It might not be very hard but needs some modifications on the program.

Steffen Wrote:(d) default color 16:
Nicola, you seem to currently use 0/0/0 always for default color 16.
I would prefer if you would use the color specified explicitly in LDConfig.ldr (some "medium" default grey).
To you already use that file? You can always get the most recent version also from the ldraw.org site.

I've yet to understand completely how color works, but i got that 16 is actually the "current color", and i correcly substitute it with what "parent lines" says, it's not hardcoded to 0. What i miss is the whole "complementary" colors and code 24.

Steffen Wrote:(e) edges:
you currently are not rendering edges at all.
I would like to have a checkbox or button for toggling that on and off.
It should be nearly trivial to add the drawing of them to your existing implementation.

Normal edges would be trivial, conditional edges will be not Smile They're one of the most puzzling quirks of LDraw file model. Basically you cannot just send them to OpenGL as a bunch of vectors, you have to manually test one by one and decide if you should draw them with a quite complex algorithm. It looks like some kind of hardcoded, precalculated "toon shading" like algorithm?
What i'd like to do is to use them to see if faces should be smooth or flat (basically what they tell is if the two faces should be "curved" or separated) so that i can render curved part nicely, but that require some work.

Steffen Wrote:Nicola, I am again falling of my chair, impressed.
I just tested the attached file, which uses an LSYNTH synthesized cable,
plus unofficial parts, it loaded quickly and smooth, and looked beautiful!

That's not my merit, LSynth generates standard faces, i didn't do anything special for it Smile

Steffen Wrote:
Code:
var flip = geometry._inverting ^ (det<0.0) ^ (!ccw); // kungfu

hahahaha, liked that

Lol, that code required quite a lot of trial and error Smile Another quirk of LDraw is how it mixes CCW and CW faces and how it "inverts" subparts Smile
More details: Works fine with Chrome, but not with Seamonkey (a Firefox variant).
Otherwise, really great!
Crossed posts... but no, it's doesn't work better now Sad
Quote:I've yet to understand completely how color works, but i got that 16 is actually the "current color", and i correcly substitute it with what "parent lines" says, it's not hardcoded to 0. What i miss is the whole "complementary" colors and code 24
Indeed, color 16 "inherits" color of parent part. Problem is if there is no parent (eg. if you paste the code of a LDraw part in copypaste.html). This requires the definition of a "default color" to be used in that case.
Color 24 does the same, but for edge lines.
Quote: It looks like some kind of hardcoded, precalculated "toon shading" like algorithm?
I think it can be described this way...
Quote:What i'd like to do is to use them to see if faces should be smooth or flat (basically what they tell is if the two faces should be "curved" or separated) so that i can render curved part nicely, but that require some work.
That's what LDview does.
Working now! Just loaded a MPD containing an unofficial. Jaw-dropping!

w.
Still nothing here. Could a cache issue be possible?
Philippe Hurbain Wrote:Still nothing here. Could a cache issue be possible?

Maybe yes, did you tried cleaning your browser cache?
No I didn't - and didn't need so! It now works fine with Seamonkey...
Really great work Wink
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16