<div dir="ltr"><div>Hi Joe,</div><div class="gmail_extra"><br></div><div class="gmail_extra">it is not entirely unreasonable to consider and explore Proto-less and x3d script-less designs if the goal is to become well integrated on the existing web platform. Both concepts are pretty foreign in this world and have their own alternatives there. I believe x3dom originated around this idea and is overall pretty successful.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, May 31, 2017 at 1:37 PM, Joe D Williams <span dir="ltr"><<a href="mailto:joedwil@earthlink.net" target="_blank">joedwil@earthlink.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
X3DOM does not have Proto/ExternProto feature.<br>
</blockquote>
<br>
big weakness thatwe may be able to fix.<br>
<br></blockquote><div><br></div><div>John essentially fixed this with the expander, I believe.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It does not have X3D Script node.<br>
</blockquote>
<br>
BIg weakness we should be able to fix<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The integration with HTML is too close to allow an X3D<br>
</blockquote>
Script node.<br>
<br>
at this point who is holding that opinion beside you<br></blockquote><div><br></div><div>Well, although cobweb and its dom integration cobweb-dom show that it is possible have both, DOM scripts along with x3d scripts, it is important to keep in mind that cobweb was developed as a strict x3d browser, whereas x3dom was never intended to work with x3d script nodes and user (x3d scene) defined fields. So while it may be perhaps possible to allow X3D script nodes in x3dom, it will probably require a pretty messy solution and/or a large effort with not too enjoyable mind twisting.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
HTML JavaScript (via DOM and X3D node manipulation) is<br>
</blockquote>
available and used extensively<br>
<br>
Yes, and we must acknowledge that compared to x3d the dom scripting is complicated and not certain as for timing. These are weakness we should fix.<br></blockquote><div><br></div><div>I agree that X3D's abstract time model which is so important for simulations is not immediately available in web browser's DOM support. However, a large majority of the vast number of web developers would probably find x3d scripting rather strange (at first), perhaps even complicated.</div><div><br></div><div>Small side nitpick: Javascript as a language requires declaring local variables with a var statement. Without the var statement variables are considered globally, eg. scoped across x3d script nodes, even from within function or other code blocks. Most x3d scripts do not use a var statement, for some reason. Perhaps the global scope is considered to be restricted to a single script node ? This would likely be impossible to enforce on a HTML page. I believe cobweb resorts to manually inserting var statement to provided script code before executing (evaluating) it. Why do x3d js scripts often avoid var statements ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
By your reasoning, it seems we must deal with no protos, no x3d scripts, and limited to weak CSS with only simple CSS animations or DOM scripts. Why insist on containing x3d in such a small box.<br>
<br></blockquote><div><br></div><div>There should be room for both a fully featured x3d as well as a x3d-web (w3d, xseen) which is designed around playing nice with other web technology.</div><div><br></div><div>Here went another 30 minutes, thanks for reading.</div><div><br></div><div>Andreas</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
----- Original Message ----- From: "Leonard Daly" <<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.com</a>><br>
To: "John Carlson" <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>; "Andreas Plesch" <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>>; <<a href="mailto:holger.seelig@yahoo.de" target="_blank">holger.seelig@yahoo.de</a>><br>
Cc: <<a href="mailto:x3dom-users@lists.sourceforge.net" target="_blank">x3dom-users@lists.sourceforge<wbr>.net</a>>; "X3D Graphics public mailing list" <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
Sent: Saturday, May 20, 2017 9:17 PM<br>
Subject: Re: [x3dom-users] Cobweb_dom...Script Magic? Loading DOM subscenes after parent in X3DOM and Cobweb. ALMOST complete, requires sequencing of outer functions.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
John,<br>
<br>
I don't really like to answer this way, but why?<br>
<br>
X3DOM does not have Proto/ExternProto feature. It does not have X3D<br>
Script node. The integration with HTML is too close to allow an X3D<br>
Script node. HTML JavaScript (via DOM and X3D node manipulation) is<br>
available and used extensively. X3DOM does not handle VRML (meaning a<br>
text file with {} syntax). There is an unofficial JSON loader. Perhaps<br>
you have one too. How does it get the scene graph into DOM? Does it<br>
create DOM elements (or perhaps an HTML text string which is then<br>
parsed)? Something else?<br>
<br>
To the extent I understand your question, you are asking for help in<br>
constructing a means of handling X3D Script node in X3DOM. Once that is<br>
done, Proto/ExternProto would be next. This would all come into the<br>
browser through an JSON encoded file. It seems to me that trying to<br>
handle X3D Script code requires an entire infrastructure supporting the<br>
X3D event mode and calling script code with X3D arguments. It also<br>
requires building full support for SAI and supporting the 'directOutput'<br>
field. That is a major effort with no obvious purpose that I see in V4.<br>
<br>
You are asking for some serious time support (I think) into an<br>
application that is neither fully X3D-compliant, nor DOM-compliant (but<br>
the closest to both that is available). At least for me, I do not<br>
understand how this effort would further an X3D integrated DOM system. I<br>
am quite willing to listen to your reasons and help where I can, but I<br>
would like to see where this is going first.<br>
<br>
Leonard Daly<br>
<br>
P.S.  Everything above is for client-side code. Server side code can<br>
manipulate things as much as it wants to create something that runs in a<br>
client-side browser.<br>
<br>
P.P.S. I do think there is a need to JSON encoding in V4 subject to the<br>
node definition for V4.<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, Leonard, for quite some time I have an X3D JSON<br>
PROTOtypeExpander.js that works with X3D PROTOs and EXTERNPROTOs and<br>
displays in X3DOM.  I don’t know how complete it is, and testers are<br>
welcome. My EXTERNPROTO expander runs on the server, so is not<br>
included in the message, but it is included in the link in the<br>
original message.  If someone can make the EXTERNPROTO expander work<br>
client side that would be great.<br>
<br>
The EXTERNPROTO expander is generally called like:<br>
<br>
                json = externPrototypeExpander(outfil<wbr>e, json);<br>
<br>
Where json is the parent json of the extern, and outfile is the parent<br>
X3D file being loaded (I think “” will probably do in a pinch.  I am<br>
not sure.).  The extern PROTOs will be included in the original JSON<br>
as a ProtoDeclare object.  You may have to run the flattener<br>
afterwards, and it is run as:<br>
<br>
json = flattener(json);<br>
<br>
It removes empty objects from the JSON.<br>
<br>
Yes, I would like someone to help me with VRMLScript for X3DOM, if<br>
someone is available.  I have a very barebones and incorrect<br>
implementation here:<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Script.js" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/node/Script.js</a><br>
<br>
Please help.  I don’t know the X3D event model, and I’m not likely to<br>
learn soon.  The X3D event model can be emulated in Browser-side<br>
JavaScript, but there’s only Cobweb for proof.<br>
<br>
<br>
I have another version of flipper.html here that works with X3DOM and<br>
Cobweb adding the subscene later.  It works with Promises, but the<br>
functions still aren’t separated…close, but no cigar.  Take a look:<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/html/flipper.html</a><br>
<br>
Sorry, I tend to use the XML version of “Proto”, and not the VRML “PROTO”.<br>
<br>
X3DJSONLD provides an infrastructure for X3D JSON Browser development,<br>
including X3D XML -> X3D JSON conversion on the server, and X3D JSON<br>
to X3D XML loading into X3DOM and Cobweb.  It also includes<br>
conversions from XML DOM to Java and Nashorn JavaScript for X3DJSAIL<br>
app development.<br>
<br>
There is definite potential for an XML PROTO expander, as I have<br>
written this code, but not seriously tested:<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/CompleteXMLPrototypeExpander.js" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/node/CompleteXMLPrototype<wbr>Expander.js</a><br>
<br>
So far, it’s still server-side.  If you’re going to modify it, split<br>
it into server and client-side pieces, please.  Complete is probably a<br>
misnomer…<br>
<br>
Thanks,<br>
<br>
John<br>
<br>
Sent from Mail <<a href="https://go.microsoft.com/fwlink/?LinkId=550986" rel="noreferrer" target="_blank">https://go.microsoft.com/fwli<wbr>nk/?LinkId=550986</a>> for<br>
Windows 10<br>
<br>
*From: *Leonard Daly <mailto:<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.c<wbr>om</a>><br>
*Sent: *Saturday, May 20, 2017 7:17 PM<br>
*To: *John Carlson <mailto:<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>; Andreas Plesch<br>
<mailto:<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.co<wbr>m</a>>; <a href="mailto:holger.seelig@yahoo.de" target="_blank">holger.seelig@yahoo.de</a><br>
<mailto:<a href="mailto:holger.seelig@yahoo.de" target="_blank">holger.seelig@yahoo.de</a><wbr>><br>
*Cc: *<a href="mailto:x3dom-users@lists.sourceforge.net" target="_blank">x3dom-users@lists.sourceforge<wbr>.net</a><br>
<mailto:<a href="mailto:x3dom-users@lists.sourceforge.net" target="_blank">x3dom-users@lists.sour<wbr>ceforge.net</a>>; X3D Graphics public<br>
mailing list <mailto:<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
*Subject: *Re: [x3dom-users] Cobweb_dom...Script Magic? Loading DOM<br>
subscenesafter parent in X3DOM and Cobweb.<br>
<br>
John,<br>
<br>
    Cobweb_dom, X3DOM experts, I need some help adding a child DOM<br>
    scenegraph with prototypes to a parent DOM scenegraph after the<br>
<br>
<br>
Not sure how any of this applies to X3DOM as it does not have PROTOs.<br>
Assuming you mean X3D prototypes via PROTO or EXTERNPROTO. If you mean<br>
something else, please elaborate.<br>
<br>
<br>
Leonard Daly<br>
<br>
<br>
<br>
<br>
    primary scene has been  loaded, and not before. I have an example<br>
    of loading before the scene is loaded, and in a callback.  If you<br>
    have an example with Promises instead of callback nesting, that<br>
    would be more ideal, the second $.getJSON() (child scenegraph)<br>
    might finish before the first $.getJSON() (parent scenegraph) if I<br>
    don’t use promises or callback nesting. Also, Promises would allow<br>
    me to separate the parent loading somewhat from the child loading,<br>
    and create separate functions.  Also, X3DOM experts can provide an<br>
    example with Promises as well. Meanwhile, I will be reading about<br>
    Promises.<br>
<br>
    Here is my example so far:<br>
<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/html/flipper.html</a><br>
<br>
    Viewable here:<br>
<br>
    <a href="https://coderextreme.net/X3DJSONLD/src/main/html/flipper.html" rel="noreferrer" target="_blank">https://coderextreme.net/X3DJS<wbr>ONLD/src/main/html/flipper.<wbr>html</a><br>
<br>
    The white Box is the subscene of the dolphin scene.<br>
<br>
    The following related code is from<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/loaderJQuery.js" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/node/loaderJQuery.js</a><br>
<br>
    and references code from:<br>
<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/X3DJSONLD.js" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/node/X3DJSONLD.js</a><br>
<br>
    [ actually, I think the last two reference each other – naughty ]<br>
<br>
    Data is here:<br>
<br>
    [ child scenegraph ]<br>
<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/abox.json" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/data/abox.json</a><br>
<br>
    [ parent scenegraph ]<br>
<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/flipp.json" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/data/flipp.json</a><br>
<br>
    Cobweb doesn’t need the prototypeExpander or the flattener (well,<br>
    it might have with prototypes in cobweb_dom, but I think the last<br>
    release fixed that…haven’t checked—here is a good test for you!).<br>
    This is a dual example, and I haven’t figured out how to<br>
    conditionally run the prototypeExpander on only X3DOM code.<br>
    Please test without the PrototypeExpander.js and Flattener.js<br>
    included, and remove X3DOM, since it won’t work in that case.<br>
    X3DOM folks can include the two JavaScript files which are here:<br>
<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PrototypeExpander.js" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/node/PrototypeExpander.js</a><br>
<br>
<br>
<a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Flattener.js" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD/blob/master/src/<wbr>main/node/Flattener.js</a><br>
<br>
    You may provide your own appendInline (below) which doesn’t call<br>
    loadSchema.  That may be too complex of a download.  That is, you<br>
    probably don’t want to do all that JSON schema validation in your<br>
    example.  Try to keep my code close to what it is otherwise.<br>
<br>
    And if you start supporting X3D JSON in your viewers, that would<br>
    be even better!<br>
<br>
    John<br>
<br>
    /**<br>
<br>
    ·Next is passed the element parameter<br>
<br>
    ·*/<br>
<br>
    function appendInline(element, url, next) {<br>
<br>
    $.getJSON(url, function(json) {<br>
<br>
    if (typeof prototypeExpander === 'function') {<br>
<br>
    json = prototypeExpander(url, json, "");<br>
<br>
    } else {<br>
<br>
    console.error("Perhaps you need to include the<br>
    PrototypeExpander.js?");<br>
<br>
             }<br>
<br>
    if (typeof flattener === 'function') {<br>
<br>
    json = flattener(json);<br>
<br>
    } else {<br>
<br>
    console.error("Perhaps you need to include the Flattener.js?");<br>
<br>
    }<br>
<br>
         // must validate here because we call an inner method.<br>
<br>
    loadSchema(json, url, doValidate, function() {<br>
<br>
    ConvertToX3DOM(json["X3D"]["Sc<wbr>ene"], "Scene", element, url);<br>
<br>
    next(element);<br>
<br>
           }, function(e) {<br>
<br>
    console.error(e);<br>
<br>
    });<br>
<br>
    }).fail(function(jqXHR, textStatus, errorThrown) { alert('getJSON<br>
    request failed! ' + textStatus + ' ' + errorThrown); });<br>
<br>
    }<br>
<br>
    /**<br>
<br>
    ·Next is passed the selected element from selector<br>
<br>
    ·Selector is the CSS selector to append inline to.<br>
<br>
    ·*/<br>
<br>
    function loadSubscene(selector, url, next) {<br>
<br>
    appendInline(document.querySel<wbr>ector(selector), url, next);<br>
<br>
    }<br>
<br>
<br>
<br>
<br>
    ------------------------------<wbr>------------------------------<wbr>------------------<br>
<br>
    Check out the vibrant tech community on one of the world's most<br>
<br>
    engaging tech sites, Slashdot.org!<a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/s<wbr>lashdot</a><br>
<br>
<br>
<br>
<br>
    ______________________________<wbr>_________________<br>
<br>
    X3dom-users mailing list<br>
<br>
    <a href="mailto:X3dom-users@lists.sourceforge.net" target="_blank">X3dom-users@lists.sourceforge.<wbr>net</a><br>
    <mailto:<a href="mailto:X3dom-users@lists.sourceforge.net" target="_blank">X3dom-users@lists.sour<wbr>ceforge.net</a>><br>
<br>
    <a href="https://lists.sourceforge.net/lists/listinfo/x3dom-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/x3dom-users</a><br>
<br>
-- <br>
*Leonard Daly*<br>
3D Systems & Cloud Consultant<br>
LA ACM SIGGRAPH Chair<br>
President, Daly Realism - /Creating the Future/<br>
<br>
</blockquote>
<br>
-- <br>
*Leonard Daly*<br>
3D Systems & Cloud Consultant<br>
LA ACM SIGGRAPH Chair<br>
President, Daly Realism - /Creating the Future/<br>
<br>
</blockquote>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>--------------------<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
------------------------------<wbr>------------------------------<wbr>------------------<br>
Check out the vibrant tech community on one of the world's most<br>
engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
</blockquote>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>--------------------<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
______________________________<wbr>_________________<br>
X3dom-users mailing list<br>
<a href="mailto:X3dom-users@lists.sourceforge.net" target="_blank">X3dom-users@lists.sourceforge.<wbr>net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/x3dom-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/x3dom-users</a><br>
<br>
</blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div>