<div dir="ltr">I experimented with redefining the field event (set_fraction) function of the x3d script itself:<br><div><div><br><a href="https://x3d-v4-very-mixed-scripting.glitch.me/">https://x3d-v4-very-mixed-scripting.glitch.me/</a><br><br></div><div>Clicking the flatY button now toggles animation of the ball color<br><a href="https://glitch.com/edit/#!/x3d-v4-very-mixed-scripting?path=index.html:153:6">https://glitch.com/edit/#!/x3d-v4-very-mixed-scripting?path=index.html:153:6</a><br><br></div><div>by toggling between the original set_fraction function and an augmented set_fraction function as the set_fraction function in usage.<br><br></div><div>The augmented set_fraction function uses the DOM API to modify the ball color (using the routed fraction value nonetheless), and then calls the original set_fraction function to do the interpolation.<br><br></div><div>So this example uses both, DOM scripting to animate and interpolate and x3d animation and scripting. <br></div><div><br></div><div>This works well but I found that it is probably not possible to redefine an x3d script function and retain the original context and scope outside the original function. Cobweb currently evals the x3d script inside another function which makes the x3d script functions closures. The point of closures is to prevent access to context and scope. Only the original function has the expected scope and context associated with it, So it can be augmented by surrounding statements but not modified.<br><br></div><div>There is an additional cobweb specific .set_live__ call which turned out to be necessary since cobweb does not expect such redefinitions.<br><br></div><div>Not sure what implications there are for more formal x3dscript node as DOM node integration. Following cobweb it could be a special script which has an expanded set of global objects, reserved function names for the lifecycle callbacks and the user defined field callbacks. In some ways it could be seen as convenience feature.taking advantage of its user defined fields.<br><br></div><div>Food for thought,<br></div><div><br></div><div>-Andreas<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 13, 2017 at 1:56 PM, 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="ltr"><div>Hi John, Leonard,<br><br></div>good point. cobweb_dom may not be necessary with <br><div><p class="MsoNormal"><a href="https://x3d-v4-mixed-scripting.glitch.me/" target="_blank">https://x3d-v4-mixed-scripting<wbr>.glitch.me/</a></p><p class="MsoNormal"><br></p><p class="MsoNormal">since it does not use direct DOM manipulation for the Scene.</p><p class="MsoNormal"><br></p><p class="MsoNormal">With cobweb_dom you can in parallel still manipulate the scene via DOM API.<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">I remembered that with cobweb_dom all x3d DOM elements get their x3d node object exposed as domNode.x3d . And, indeed, the x3d script element, x3dScript=document.<wbr>querySelector("[DEF=INTERP]"), has a property .x3d which has the context array I had referred to earlier.</p><p class="MsoNormal"><br></p><p class="MsoNormal">So x3dScript.x3d.context.set_<wbr>fraction is actually available to an HTML script and could be redefined. It could be possible to directly redefine set_fraction() although I am not sure if there is a benefit.<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">I am not sure if after it is redefined, the same 'with' expanded prototype chain (expanded global) still could be made to apply, and how the function context would work. Time for some more experiments.</p><p class="MsoNormal"><br></p><p class="MsoNormal">-Andreas<br></p></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 13, 2017 at 12:52 PM, John Carlson <span dir="ltr"><<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="m_-4665111668511896521gmail-m_524162945316276436WordSection1"><p class="MsoNormal">Thanks Andreas!  I would like to add that you can load the Cobweb scene from JSON with my extensions with HTML script, via DOM (built into Cobweb—No need for Cobweb_dom).  Now if only modifying the JS Object would modify the X3D scene and vica versa (TODO, suggestion to use Cobweb_dom instead).</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am wondering if the only thing that was failing in my attempt to put proxies in my JS “scenegraph” was that they only had set proxies, and not get proxies, thus I could not read the value from the proxy.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">John</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class="MsoNormal"><u></u> <u></u></p><div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(225,225,225) currentcolor currentcolor;padding:3pt 0in 0in"><p class="MsoNormal" style="border-width:medium;border-style:none;border-color:currentcolor;padding:0in"><b>From: </b><a href="mailto:andreasplesch@gmail.com" target="_blank">Andreas Plesch</a><br><b>Sent: </b>Sunday, August 13, 2017 12:10 PM<br><b>To: </b><a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard Daly</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org" target="_blank">X3D Graphics public mailing list</a>; <a href="mailto:yottzumm@gmail.com" target="_blank">John Carlson</a><br><b>Subject: </b>Re: Script Illustrative Example [was: X3D Specification Relationshipsdiagram]</p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">And here is a version which mixes x3d and html scripting:</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><a href="https://x3d-v4-mixed-scripting.glitch.me/" target="_blank">https://x3d-v4-mixed-scripting<wbr>.glitch.me/</a></p></div><div><p class="MsoNormal">forkable source:</p></div><p class="MsoNormal"><a href="https://glitch.com/edit/#%21/x3d-v4-mixed-scripting?path=index.html:69:4" target="_blank">https://glitch.com/edit/#!/x3d<wbr>-v4-mixed-scripting?path=index<wbr>.html:69:4</a></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The idea to use a redefinable global function in a x3d field function worked fine.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Above now uses regular x3d animation via timesensor and routes. The x3d script acts as an interpolator accepting set_fraction input. It does end up not using the fraction since the original animation was defined in terms of clock time. So the script also uses timestamps and the original changeY and linearX global html script functions. The redefinition of changeY via button names is unchanged.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It would be nicer to define the interpolators in terms of a fraction but that is secondary.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The x3dom approach would be to use its onOutputChange event:</p></div><div><p class="MsoNormal"> <a href="https://doc.x3dom.org/tutorials/animationInteraction/onoutputchange/index.html" target="_blank">https://doc.x3dom.org/tutoria<wbr>ls/animationInteraction/onoutp<wbr>utchange/index.html</a></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">for defining a custom interpolator.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">-Andreas</p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Sat, Aug 12, 2017 at 10:40 AM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:</p><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><p class="MsoNormal">Hi Leonard,</p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">here is a version of the example which uses cobweb with cobweb-dom for DOM API use.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><a href="https://x3d-v4-scripting-cobweb.glitch.me/" target="_blank">https://x3d-v4-scripting-cobwe<wbr>b.glitch.me/</a></p></div><div><p class="MsoNormal">and</p></div><div><p class="MsoNormal"><a href="https://glitch.com/edit/#%21/x3d-v4-scripting-cobweb?path=index.html:63:1" target="_blank">https://glitch.com/edit/#!/x3d<wbr>-v4-scripting-cobweb?path=inde<wbr>x.html:63:1</a></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The necessary changes were minor:</p></div><div><p class="MsoNormal">- The display area div needed to be replaced with a x3d canvas</p></div><div><p class="MsoNormal">- The ball div needed to become a sphere shape transform</p></div><div><p class="MsoNormal">- The ball position is set via the translation attribute rather than position style properties.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The viewpoint is at a distance such that 1px in the original div rectangle corresponds to about 1m in the x3d scene when viewed from the viewpoint.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Otherwise no changes are needed since full control via the DOM API is possible.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I also found that I need to update cobweb-dom to work with the latest cobweb since there were some changes in the cobweb parser. The current cobweb-dom only works with cobweb < 3.0.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I suppose the next question is if one can use x3d scripts instead of the html scripts or somehow mix and match. What functionality should be provided in an x3d script ? The tricky thing to try maybe to do the animation inside x3d but replace the x3d interpolator with a custom interpolator from an html script ? Maybe I can think of something.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">-Andreas</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Sat, Aug 12, 2017 at 1:13 AM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:</p><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">I went back to the cobweb repo to very carefully read through the rather mind bending script node code in </p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><a href="https://github.com/create3000/cobweb/blob/master/cobweb.js/cobweb/Components/Scripting/Script.js" target="_blank">https://github.com/create3000/<wbr>cobweb/blob/master/cobweb.js/c<wbr>obweb/Components/Scripting/Scr<wbr>ipt.js</a></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">and came to the conclusion that the x3d scripts are only evaled once during initialization, contrary to what I had thought. The script text is cleverly appended with an array of all defined named functions which then becomes the return value of the eval call. These functions are then stored in a local scope this.context object, essentially as methods. Then, whenever a lifecycle function or a field function needs to be executed, the context method is called.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">One could probably expose this context object and then redefine its methods from Dom scripts. However, one would lose the cobweb constructed "with" "global" object which allows easy and standard access to x3d functions and user defined fields. It could be probably reconstructed if needed.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I may try to convert the example to cobweb dom.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Andreas</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">-The formatting survived the direct mail but not the route through the list probably because I receive digests.</p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Aug 11, 2017 9:03 PM, "Leonard Daly" <<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.com</a>> wrote:</p><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal" style="margin-bottom:12pt">I was asked by John to construct an example illustrating the items listed below. I also have replies to Andreas' comments. The original message is at the bottom (for reference). I've copied the relevant questions/statements to the top to make reading easier.<br><br>First to the example. It is located at <a href="http://tools.realism.com/development/WG-Support/2017-08-09/ScriptIllustration.html" target="_blank">http://tools.realism.com/devel<wbr>opment/WG-Support/2017-08-09/<wbr>ScriptIllustration.html</a><br>It does not use Cobweb since I can't begin to figure out how to do this in Cobweb. OTOH, if X3D is DOM integrated, then the it shouldn't matter where various functions and methods are located.<br><br>The example is strictly 2D, but I think it clearly illustrates the goal. The default Y interpolator is nothing (no change). Selecting different buttons change the interpolator in real-time. Each interpolator is defined as a function. The variable 'changeY' holds the current interpolator. When a button is pressed, the value of 'changeY' is set to the selected interpolator. There is no 'case' statement the uses the correct interpolator on each pass through the animation loop.<br><br>John if this doesn't illustrate the concept, please explain what you need to see.<br><br>Andreas, you have done and continue to do a lot in support of web 3D, especially wrt to X3DOM. I continue to be impressed with your solutions to problems presented to that list. [I'll have one soon, with a potential solution.]<br><br></p><div><p class="MsoNormal"><span style="color:rgb(51,51,255)">AP: Mixing DOM and x3d scripts is inherently problematic since x3d scripts expect their own environment (scope). But let's see.</span></p></div><div><p class="MsoNormal"><span style="color:rgb(51,51,255)"> </span></p></div><p class="MsoNormal" style="margin-bottom:12pt"><span style="color:rgb(51,51,255)">AP: Not sure if x3d scripts should be available globally, eg. as window.foo which means foo is global. This would mean that any other script or framework needs to be careful not to use the same function names.<br><br>AP: window.x3d should be nicer, as a dedicated namespace. x3dom uses the x3dom namespace.</span><br><br>If X3D and HTML are fully integrated then they will be mixed. It is now common practice to put library methods into their own namescope. This namescope is not limited, but is prefixed by a known library label (e.g., x3dom, THREE, etc.). Mandating that X3D in HTML use the 'x3d' namescope would cause problems if someone wanted to run two different libraries from the same HTML context. iframe can fix that, but it seems overly restrictive.<br><br></p><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal" style="margin-bottom:12pt"><span style="color:rgb(0,153,0)">function bar(event, time) {<br>     window.foo = bar;            // I would (perhaps) settle for window.x3d.foo = bar;<br>}</span></p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal"><span style="color:rgb(51,51,255)">AP: This currently does not work since cobweb goes back to the original function source each time the script is run. But the x3d script could probably use internally a global HTML script function which can be redefined at will, to enable a hook into an x3d script.</span><br><br>[<span style="color:rgb(0,153,0)">1]    </span></p><blockquote style="margin-top:5pt;margin-bottom:5pt"><p class="MsoNormal"><span style="color:rgb(0,153,0)"><Script ...>    <!-- X3D Script node --><br>     function foo (event, time) {<br>         window.bar = foo;<br>     }<br></script></span></p></blockquote><p class="MsoNormal"><br><span style="color:rgb(51,51,255)">AP: This probably already works since cobweb evals the function text almost as is.</span> </p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="color:rgb(51,51,255)">Is this the same as</span></p></div><div><p class="MsoNormal"><br><span style="color:rgb(0,153,0)">[2]</span></p></div><blockquote style="margin-top:5pt;margin-bottom:5pt"><div><p class="MsoNormal"><span style="color:rgb(0,153,0)">var foo = function (event, time) {do_work;};</span></p></div><div><p class="MsoNormal"><span style="color:rgb(0,153,0)">window.bar = foo;</span></p></div></blockquote><div><p class="MsoNormal"><span style="color:rgb(51,51,255)"> ?</span></p></div><p class="MsoNormal"><br>It seems to me that eval the script text each time, especially in an animation loop, is needlessly expensive. <br>The two examples (indented if that works in your mail reader) are not the same. The first example sets window.bar to be 'foo' each time it runs. The second example only sets window.bar to be 'foo' after the definition is processed. If there is something else setting window.bar after the 'foo' function definition is processed, then that definition to 'foo' is never used.<br><br><br><span style="color:rgb(51,51,255)">AP: What does the SAI say about manipulating or calling x3d script functions from the outside ? You may only be able to remove and add complete script nodes but not work with the script functions ?</span> </p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal"><span style="color:rgb(51,51,255)">AP: Proposed text would be great. For now, it may be productive to settle for slightly less integration by keeping x3d scripts pretty much internal to the x3d context but allow x3d scene control via the DOM, eg. make x3d nodes similar to svg/html elements.</span><br><br><br>This is my main point. DOM is an API. If X3D chooses to define an API in HTML, then it must be done so as not to interfere with the DOM API. Developers will use the DOM API to do things anyway. X3D should only expand on that, not restrict that. Anything less would not be full integration. There is no such thing as an SVG Script tag. It is located in the same space all all HTML scripts.<br><br><br>Leonard Daly<br><br>P.S. I hope all of the formatting and styling worked.<br><br><br><br><br><br><br>On 8/11/2017 7:33 AM, Andreas Plesch wrote:<u></u><u></u></p></div><blockquote style="margin-top:5pt;margin-bottom:5pt"><div><div><div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal">Date: Thu, 10 Aug 2017 18:31:25 -0700<br>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>>, X3D Graphics public mailing<br>        list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>>, Web3D Consortium <<a href="mailto:consortium@web3d.org" target="_blank">consortium@web3d.org</a>><br>Cc: X3D Graphics Working Group <<a href="mailto:x3d@web3d.org" target="_blank">x3d@web3d.org</a>><br>Subject: Re: [x3d-public] [x3d] X3D Specification Relationships<br>        diagram</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Leonard, thanks for raising this, and I appreciate your attempt to rally broader support around v4 and web compatibility. I continue to do what I can which is not too much these days.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal" style="margin-bottom:12pt">On 8/10/2017 5:17 PM, John Carlson wrote:<br>><br>> Leonard wrote:<br>><br>> >and node name collisions (i.e., Script).<br>><br>> There has been quite a bit of progress with this and X3DJSONLD and<br>> X3DOM. It?s been under the covers because I have not advertised it<br>> much. I have several scripts running, but not the full complement of<br>> my examples.  It does not run the X3D event model yet, except for<br>> initialize().<br>><br>> Cobweb of course, already handles this, so quit bellyaching.<br>><br><br>Cobweb even with Andreas' DOM interface extensions does not integrate<br>with the DOM regarding Scripts. A full integration would allow the<br>following:</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Mixing DOM and x3d scripts is inherently problematic since x3d scripts expect their own environment (scope). But let's see.</p></div><div><p class="MsoNormal"> </p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal" style="margin-bottom:12pt">X3D Script function called 'foo'<br>HTML script function called 'bar'<br><br>In the body of bar, I should be able to redefine 'foo'. It is (in a<br>fully integrated system) available as window.foo. Similarly for inside<br>of 'foo' to change 'bar'.</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Not sure if x3d scripts should be available globally, eg. as window.foo which means foo is global. This would mean that any other script or framework needs to be careful not to use the same function names.</p></div><div><p class="MsoNormal"> </p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal" style="margin-bottom:12pt">function bar(event, time) {<br>     window.foo = bar;            // I would (perhaps) settle for<br>window.x3d.foo = bar;<br>}</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">window.x3d should be nicer, as a dedicated namespace. x3dom uses the x3dom namespace.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">This currently does not work since cobweb goes back to the original function source each time the script is run. But the x3d script could probably use internally a global HTML script function which can be redefined at will, to enable a hook into an x3d script.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal" style="margin-bottom:12pt">and<br><br><Script ...>    <!-- X3D Script node --><br>     function foo (event, time) {<br>         window.bar = foo;<br>     }<br></script></p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">This probably already works since cobweb evals the function text almost as is.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Is this the same as</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">var foo = function (event, time) {do_work;};</p></div><div><p class="MsoNormal">window.bar = foo;</p></div><div><p class="MsoNormal"> ?</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal" style="margin-bottom:12pt">I should be able to construct an object with 'foo' as a method. E.g.,<br><br>var globalVar = {};<br>globalVar.x3d = foo;<br><br>// should call the X3D script passing it a reference to the current<br>value of 'event' and 'time'.<br>globalVar.x3d(event, time);</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It may be possible to 'export' named x3d script functions to window.x3d, so they can be called. cobweb would currently redefine a named function each time an x3d script is executed.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal"><br>Inside 'foo' I should be able to access any DOM element to get it's<br>current state or even establish an event listener.</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">You should be able to do that in cobweb now although it would be strange to find DOM code in an X3D script. Perhaps for HUD of GUI purposes it could be useful, actually.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal"><br>I know there are some things that Cobweb can do, but there has been no<br>discussions in the WG for the language that would be necessary to ensure<br>HTML/DOM/X3D interaction like I described above.</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">What does the SAI say about manipulating or calling x3d script functions from the outside ? You may only be able to remove and add complete script nodes but not work with the script functions ?</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal"><br>Unrolling scripts on the server (or at least not in the runtime of the<br>browser) is all fine and good, but again there has been no discussion in<br>the WG as to how to even approach writing that up.<br><br>I will be happy to be (relatively) quiet on these points if someone can<br>show me working examples and proposed text to make this work.</p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Proposed text would be great. For now, it may be productive to settle for slightly less integration by keeping x3d scripts pretty much internal to the x3d context but allow x3d scene control via the DOM, eg. make x3d nodes similar to svg/html elements.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">-Andreas</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal"><br><br>--<br>*Leonard Daly*<br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - /Creating the Future/<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170810/93cc05ca/attachment.html" target="_blank">http://web3d.org/pipermail/x3<wbr>d-public_web3d.org/attachments<wbr>/20170810/93cc05ca/attachment.<wbr>html</a>><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>______________________________<wbr>_________________<br>x3d-public mailing list<br><a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" target="_blank">http://web3d.org/mailman/listi<wbr>nfo/x3d-public_web3d.org</a><br><br><br>------------------------------<br><br>End of x3d-public Digest, Vol 101, Issue 9<br>******************************<wbr>************</p></blockquote></div><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal"><span class="m_-4665111668511896521gmail-m_524162945316276436gmail-m3040691064007112017m4854531439596135322hoenzb"><span style="color:rgb(136,136,136)">-- <u></u><u></u></span></span></p><div><p class="MsoNormal"><span style="color:rgb(136,136,136)">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</span></p></div></div></div><p class="MsoNormal" style="margin-bottom:12pt"><span class="m_-4665111668511896521gmail-m_524162945316276436gmail-m3040691064007112017m4854531439596135322hoenzb"><u></u> <u></u></span></p><pre><span style="color:rgb(136,136,136)">______________________________<wbr>_________________<u></u><u></u></span></pre><pre><span style="color:rgb(136,136,136)">x3d-public mailing list<u></u><u></u></span></pre><pre><span style="color:rgb(136,136,136)"><a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><u></u><u></u></span></pre><pre><span style="color:rgb(136,136,136)"><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" target="_blank">http://web3d.org/mailman/listi<wbr>nfo/x3d-public_web3d.org</a><u></u><u></u></span></pre></blockquote><p><u></u> <u></u></p><div><p class="MsoNormal"><span style="color:rgb(136,136,136)">-- <br></span><b><span style="font-size:13.5pt;color:rgb(51,51,102)">Leonard Daly</span></b><span style="color:rgb(51,51,102)"><br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - <i>Creating the Future</i></span><span style="color:rgb(136,136,136)"><u></u><u></u></span></p></div></div></blockquote></div></div></div></div></blockquote></div><p class="MsoNormal"><span style="color:rgb(136,136,136)"><br><br clear="all"></span><span class="m_-4665111668511896521gmail-m_524162945316276436gmail-m3040691064007112017hoenzb"><u></u><u></u></span></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal"><span class="m_-4665111668511896521gmail-m_524162945316276436gmail-m3040691064007112017hoenzb"><span style="color:rgb(136,136,136)">-- </span><u></u><u></u></span></p><div><p class="MsoNormal"><span style="color:rgb(136,136,136)">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</span></p></div></div></blockquote></div><p class="MsoNormal"><br><br clear="all"></p><div><p class="MsoNormal"><u></u> <span class="HOEnZb"><font color="#888888"><u></u></font></span></p></div><span class="HOEnZb"><font color="#888888"><p class="MsoNormal">-- </p></font></span></div></div><span class="HOEnZb"><font color="#888888"><p class="MsoNormal">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</p><p class="MsoNormal"><u></u> <u></u></p></font></span></div></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="m_-4665111668511896521gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</font></span></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div>