<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Selected responses...<br>
      <br>
    </div>
    <blockquote type="cite"
      cite="mid:C3600F3E78CF4724B88E450F43FD0BDC@joe1446a4150a8">The
      integration with HTML is too close to allow an X3D
      <br>
      Script node.
      <br>
      <br>
      at this point who is holding that opinion beside you
      <br>
    </blockquote>
    <br>
    W3C.<br>
    <br>
    <br>
    <blockquote type="cite"
      cite="mid:C3600F3E78CF4724B88E450F43FD0BDC@joe1446a4150a8">
      <br>
      <blockquote type="cite">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>
      <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>
    </blockquote>
    <br>
    You are arguing that the browser environment needs to change to
    accommodate X3D. Browser events are well defined, supported by more
    applications than X3D and used by far more people than have even
    heard of X3D.<br>
    <br>
    I never stated that X3D should be limited to weak CSS.<br>
    I never stated that X3D should use simple CSS animations.<br>
    <br>
    If you are running X3D in a browser integrated with DOM, than you
    *MUST* use DOM scripts.<br>
    <br>
    I'm trying to pull X3D into a HUGE box that has far more
    capabilities than X3D could ever handle. <br>
    <br>
    <br>
    Leonard Daly<br>
    <br>
    <blockquote type="cite"
      cite="mid:C3600F3E78CF4724B88E450F43FD0BDC@joe1446a4150a8">
      <br>
      Joe
      <br>
      <br>
      <br>
      <br>
      ----- Original Message ----- From: "Leonard Daly"
      <a class="moz-txt-link-rfc2396E" href="mailto:Leonard.Daly@realism.com"><Leonard.Daly@realism.com></a>
      <br>
      To: "John Carlson" <a class="moz-txt-link-rfc2396E" href="mailto:yottzumm@gmail.com"><yottzumm@gmail.com></a>; "Andreas Plesch"
      <a class="moz-txt-link-rfc2396E" href="mailto:andreasplesch@gmail.com"><andreasplesch@gmail.com></a>; <a class="moz-txt-link-rfc2396E" href="mailto:holger.seelig@yahoo.de"><holger.seelig@yahoo.de></a>
      <br>
      Cc: <a class="moz-txt-link-rfc2396E" href="mailto:x3dom-users@lists.sourceforge.net"><x3dom-users@lists.sourceforge.net></a>; "X3D Graphics
      public mailing list" <a class="moz-txt-link-rfc2396E" href="mailto:x3d-public@web3d.org"><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 type="cite">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 type="cite">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(outfile, 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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Script.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html">https://github.com/coderextreme/X3DJSONLD/blob/master/src/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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/CompleteXMLPrototypeExpander.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/CompleteXMLPrototypeExpander.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 class="moz-txt-link-rfc2396E" href="https://go.microsoft.com/fwlink/?LinkId=550986"><https://go.microsoft.com/fwlink/?LinkId=550986></a> for
          <br>
          Windows 10
          <br>
          <br>
          *From: *Leonard Daly <a class="moz-txt-link-rfc2396E" href="mailto:Leonard.Daly@realism.com"><mailto:Leonard.Daly@realism.com></a>
          <br>
          *Sent: *Saturday, May 20, 2017 7:17 PM
          <br>
          *To: *John Carlson <a class="moz-txt-link-rfc2396E" href="mailto:yottzumm@gmail.com"><mailto:yottzumm@gmail.com></a>; Andreas
          Plesch
          <br>
          <a class="moz-txt-link-rfc2396E" href="mailto:andreasplesch@gmail.com"><mailto:andreasplesch@gmail.com></a>; <a class="moz-txt-link-abbreviated" href="mailto:holger.seelig@yahoo.de">holger.seelig@yahoo.de</a>
          <br>
          <a class="moz-txt-link-rfc2396E" href="mailto:holger.seelig@yahoo.de"><mailto:holger.seelig@yahoo.de></a>
          <br>
          *Cc: *x3dom-users@lists.sourceforge.net
          <br>
          <a class="moz-txt-link-rfc2396E" href="mailto:x3dom-users@lists.sourceforge.net"><mailto:x3dom-users@lists.sourceforge.net></a>; X3D Graphics
          public
          <br>
          mailing list <a class="moz-txt-link-rfc2396E" href="mailto:x3d-public@web3d.org"><mailto: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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html</a>
          <br>
          <br>
              Viewable here:
          <br>
          <br>
             
          <a class="moz-txt-link-freetext" href="https://coderextreme.net/X3DJSONLD/src/main/html/flipper.html">https://coderextreme.net/X3DJSONLD/src/main/html/flipper.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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/loaderJQuery.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/loaderJQuery.js</a>
          <br>
          <br>
              and references code from:
          <br>
          <br>
          <br>
<a class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/X3DJSONLD.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/abox.json">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/abox.json</a>
          <br>
          <br>
              [ parent scenegraph ]
          <br>
          <br>
          <br>
<a class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/flipp.json">https://github.com/coderextreme/X3DJSONLD/blob/master/src/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 class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PrototypeExpander.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PrototypeExpander.js</a>
          <br>
          <br>
          <br>
<a class="moz-txt-link-freetext" href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Flattener.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/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"]["Scene"], "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.querySelector(selector), url, next);
          <br>
          <br>
              }
          <br>
          <br>
          <br>
          <br>
          <br>
             
------------------------------------------------------------------------------<br>
          <br>
              Check out the vibrant tech community on one of the world's
          most
          <br>
          <br>
              engaging tech sites, Slashdot.org!<a class="moz-txt-link-freetext" href="http://sdm.link/slashdot">http://sdm.link/slashdot</a>
          <br>
          <br>
          <br>
          <br>
          <br>
              _______________________________________________
          <br>
          <br>
              X3dom-users mailing list
          <br>
          <br>
              <a class="moz-txt-link-abbreviated" href="mailto:X3dom-users@lists.sourceforge.net">X3dom-users@lists.sourceforge.net</a>
          <br>
              <a class="moz-txt-link-rfc2396E" href="mailto:X3dom-users@lists.sourceforge.net"><mailto:X3dom-users@lists.sourceforge.net></a>
          <br>
          <br>
              <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/x3dom-users">https://lists.sourceforge.net/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>
--------------------------------------------------------------------------------
      <br>
      <br>
      <br>
      <blockquote type="cite">------------------------------------------------------------------------------
        <br>
        Check out the vibrant tech community on one of the world's most
        <br>
        engaging tech sites, Slashdot.org! <a class="moz-txt-link-freetext" href="http://sdm.link/slashdot">http://sdm.link/slashdot</a>
        <br>
      </blockquote>
      <br>
      <br>
--------------------------------------------------------------------------------
      <br>
      <br>
      <br>
      <blockquote type="cite">_______________________________________________
        <br>
        X3dom-users mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:X3dom-users@lists.sourceforge.net">X3dom-users@lists.sourceforge.net</a>
        <br>
        <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/x3dom-users">https://lists.sourceforge.net/lists/listinfo/x3dom-users</a>
        <br>
        <br>
      </blockquote>
      <br>
      <br>
    </blockquote>
    <p><br>
    </p>
    <div class="moz-signature">-- <br>
      <font class="tahoma,arial,helvetica san serif" color="#333366">
        <font size="+1"><b>Leonard Daly</b></font><br>
        3D Systems & Cloud Consultant<br>
        LA ACM SIGGRAPH Chair<br>
        President, Daly Realism - <i>Creating the Future</i>
      </font></div>
  </body>
</html>