<div dir="ltr">Once one gets used to the verbosity required by the Event Utilities component and the related ROUTEing, there is a lot of value and it often becomes possible to replace X3D scripts. Sometimes the nodes even allow for more concise expression of logic, and will enable quite a few authors to add reactivity and branching to a scene which otherwise could not do that due to a perceived (?) difficulty of scripting.<div><br><div>After spec. and other X3D viewer review for best compatibility, I completed implementation of Event Utility nodes for x3dom and requested them to be pulled into the main x3dom github repo. For now it also possible to simply load the js implementations after x3dom.js on a web page. To make this convenient, I collected all node code into a single file here:</div><div><br></div><div><a href="https://gist.github.com/andreasplesch/bc44534cb072dd0d88a77406fcecf4b0/raw/479293afc7bc15810caf98a63b5a29a6bf87b472/x3dom_eventUtilities.user.js">https://gist.github.com/andreasplesch/bc44534cb072dd0d88a77406fcecf4b0/raw/479293afc7bc15810caf98a63b5a29a6bf87b472/x3dom_eventUtilities.user.js</a><br></div><div><br></div><div>This also contains a fix for TouchSensor to enable the touchtime field which is often used in connection with the event utilities.</div><div>This file is simultaneously a user script which can be applied by a web browser to any web page. With the user script loaded many example scenes which use event utility nodes start to work as long as they do not use X3D script nodes.</div><div><br></div><div>I will also add a x3dom only ScalarSequencer node since I believe it can be very useful to access all Interpolator types and since it is very straightforward to implement.</div><div><br></div><div>Enjoy scriptless logic,</div><div><br></div><div>-Andreas</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 2, 2017 at 11:02 AM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">CoordinateDouble for x3dom would be a bit pointless but easy to implement as a CoordinateDouble.js implementation would be identical to Coordinate.js, except for the node name. No other files would need to be touched.</div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">It is part of the Nurbs component which otherwise would require substantial effort to realize.</div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">The event utilities just feel like not a good fit for a declarative style but probably could be implemented if there is a real demand. They do not seem to be used much since generally it is more natural to use a x3d or dom script for logic. Is there a convincing use case/example somewhere to promote them ? Potential users understand routing and logic but do not want to bother with scripting. Perhaps a small group but who knows.</div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">I do not think x3dom's goal is to have complete node coverage. In fact, there was an attempt to define a special profile which would fit x3dom.</div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">Although regrettably there is no developer documentation it is not hard to add functionality since the code is open and fairly well organized though aging at this point (some DOM methods it uses are deprecated for some time). X3dom is easy and fun to hack, mostly by overriding methods. Try things on glitch or jsfiddle.</div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">On the other hand there is quite a bit of extra functionality in x3dom which should inspire standardization or more widespread implementation in other viewers. CommonSurfaceShader or turntable navigation comes to mind.</div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">For reference:</div><a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/nurbs.html#CoordinateDouble" style="text-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" target="_blank"><var class="m_-7425958033251151352m_-4278308301159795541long-word" style="word-break:break-all;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-family:inherit;font-weight:inherit;font-style:inherit;font-size:inherit">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/<wbr>Part01/components/nurbs.html#C<wbr>oordinateDouble</var></a><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto"><br></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:16px;font-variant-ligatures:normal;background-color:rgb(255,255,255)" dir="auto">Andreas</div><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Sep 1, 2017 9:16 PM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br type="attribution"><blockquote class="m_-7425958033251151352m_-4278308301159795541quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No doubt many people share the concern that X3DOM development, while actively continuing, has not added support for missing X3D nodes in a long while.<br>
<br>
In years past, community source-code contributions for new nodes in X3DOM always seemed to require updating by insider experts.<br>
<br>
Am wondering if remains difficult to add new X3D nodes to the primary X3DOM build?  Making that task easier likely has great value.<br>
<br>
Towards that end, recommend the following progressive priorities to improve X3DOM node support towards X3D Immersive profile (essentially VRML97 capabilities).<br>
<br>
a. CoordinateDouble.  Hopefully just a simple variation of Coordinate node.  (Note that all floating-point values in Javascript have double precision.)  Adding this simplest-possible variation will reveal what other X3DOM files have to be modified to recognize a new node.<br>
<br>
        <a href="https://doc.x3dom.org/developer/x3dom/nodeTypes/Coordinate.html" rel="noreferrer" target="_blank">https://doc.x3dom.org/develope<wbr>r/x3dom/nodeTypes/Coordinate.h<wbr>tml</a><br>
<br>
        <a href="https://github.com/x3dom/x3dom/tree/master/src/nodes/Rendering" rel="noreferrer" target="_blank">https://github.com/x3dom/x3dom<wbr>/tree/master/src/nodes/Renderi<wbr>ng</a><br>
        <a href="https://github.com/x3dom/x3dom/blob/master/src/nodes/Rendering/Coordinate.js" rel="noreferrer" target="_blank">https://github.com/x3dom/x3dom<wbr>/blob/master/src/nodes/Renderi<wbr>ng/Coordinate.js</a><br>
<br>
b. Event utilities:  simple input-output type conversion algorithms.<br>
        BooleanFilter<br>
        BooleanSequencer<br>
        BooleanToggle<br>
        BooleanTrigger<br>
        IntegerSequencer<br>
        IntegerTrigger<br>
        TimeTrigger<br>
<br>
        EventUtilities component is not found in source tree,<br>
        <a href="https://github.com/x3dom/x3dom/tree/master/src/nodes" rel="noreferrer" target="_blank">https://github.com/x3dom/x3dom<wbr>/tree/master/src/nodes</a><br>
<br>
        X3D Abstract Specification, Event Utilities component<br>
        <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/utils.html" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19775-1/V3.3/P<wbr>art01/components/utils.html</a><br>
<br>
        Basic Examples Archive: example Javascript proto implementations<br>
        <a href="http://www.web3d.org/x3d/content/examples/Basic/development/EventUtilityPrototypesIndex.html" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/conte<wbr>nt/examples/Basic/development/<wbr>EventUtilityPrototypesIndex.ht<wbr>ml</a><br>
        <a href="http://www.web3d.org/x3d/content/examples/Basic/development/EventUtilityExamplesIndex.html" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/conte<wbr>nt/examples/Basic/development/<wbr>EventUtilityExamplesIndex.html</a><br>
<br>
Applying and improving developer documentation for new nodes would be further important to accomplish at the same time.  Not seeing a "How to Add a Node" section, however...<br>
<br>
        X3DOM Developer API Documentation<br>
        <a href="https://doc.x3dom.org/developer/index.html" rel="noreferrer" target="_blank">https://doc.x3dom.org/develope<wbr>r/index.html</a><br>
<br>
c. Prototype declarations and instances.  As ever, prototypes remain fundamental and are a key part of extensibility, literally the "X" in X3D.<br>
<br>
There have been on-again/off-again efforts to define and implement a Prototype Expander algorithm as a preprocessor for X3D players.  Seems like a good time to resume working at this.<br>
<br>
        <a href="https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes/MaterialModulatorPrototypeExpandedIndex.html" rel="noreferrer" target="_blank">https://x3dgraphics.com/exampl<wbr>es/X3dForWebAuthors/Chapter14-<wbr>Prototypes/MaterialModulatorPr<wbr>ototypeExpandedIndex.html</a><br>
        <a href="http://web3d.org/pipermail/x3d-public_web3d.org/2016-July/004982.html" rel="noreferrer" target="_blank">http://web3d.org/pipermail/x3d<wbr>-public_web3d.org/2016-July/00<wbr>4982.html</a><br>
        and many follow-on threads, steadily progressing that work, especially<br>
<br>
        Source is somewhere in:<br>
        <a href="https://github.com/coderextreme/X3DJSONLD" rel="noreferrer" target="_blank">https://github.com/coderextrem<wbr>e/X3DJSONLD</a><br>
<br>
... and so on.  Possible?<br>
<br>
It will be great if some X3DOM developers might "step up" to show that node addition is do-able.<br>
<br>
Hopefully this list helps triage simple/moderate/advanced work that is needed.<br>
<br>
Have fun with X3DOM!  8)<br>
<br>
<br>
On 9/1/2017 5:31 PM, Don Brutzman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am happy to report improvements and updates to the X3D node + statement inventory spreadsheets:<br>
<br>
     <a href="http://www.web3d.org/specifications/X3dNodeInventoryComparison.xlsx" rel="noreferrer" target="_blank">http://www.web3d.org/specific<wbr>ations/X3dNodeInventoryCompari<wbr>son.xlsx</a><br>
     <a href="http://www.web3d.org/specifications/X3dNodeInventoryComparison.pdf" rel="noreferrer" target="_blank">http://www.web3d.org/specific<wbr>ations/X3dNodeInventoryCompari<wbr>son.pdf</a><br>
<br>
Updates include readability improvements and addition of view3dscene (Castle Game Engine) support.<br>
<br>
Some interesting statistics follow, also attached in image.<br>
==============================<wbr>==============================<wbr>=========<br>
X3D Abstract Specification      Cobweb Castle X3DOM  X3D-Edit Xj3D<br>
<br>
Supported nodes and statements: 73%    57%    61%    87%      68%<br>
(251 total, X3D specification)  182    144    154    218      171<br>
<br>
Unimplemented nodes:            69     93     97     33       80<br>
<br>
needed for HTML5 support goals<br>
* required for X3D Immersive    all    all    19    all     2<br>
* suggested for HTML5 support   2      14     13    all     5<br>
* priority nodes missing:       2      14     32    0       7<br>
==============================<wbr>==============================<wbr>=========<br>
<br>
Am willing to add others, now that spreadsheet refactoring permits it.  Please send an alphabetized verified list of supported nodes.<br>
<br>
Have fun with X3D! <br>
</blockquote>
<br>
all the best, Don<font color="#888888"><br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a href="tel:%2B1.831.656.2149" value="+18316562149" target="_blank">+1.831.656.2149</a><br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzma<wbr>n</a><br>
</font><br>------------------------------<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>______________________________<wbr>_________________<br>
x3dom-developers mailing list<br>
<a href="mailto:x3dom-developers@lists.sourceforge.net" target="_blank">x3dom-developers@lists.sourcef<wbr>orge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/x3dom-developers" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/x3dom-developer<wbr>s</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div>
</div>