<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Date: Thu, 10 Aug 2017 18:31:25 -0700<br>
From: Leonard Daly <<a href="mailto:Leonard.Daly@realism.com">Leonard.Daly@realism.com</a>><br>
To: John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>>, X3D Graphics public mailing<br>
        list <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>>, Web3D Consortium <<a href="mailto:consortium@web3d.org">consortium@web3d.org</a>><br>
Cc: X3D Graphics Working Group <<a href="mailto:x3d@web3d.org">x3d@web3d.org</a>><br>
Subject: Re: [x3d-public] [x3d] X3D Specification Relationships<br>
        diagram<br></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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:<br>
<br></blockquote><div><br></div><div>Mixing DOM and x3d scripts is inherently problematic since x3d scripts expect their own environment (scope). But let's see.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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'.<br>
<br></blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
function bar(event, time) {<br>
     window.foo = bar;            // I would (perhaps) settle for<br>
window.x3d.foo = bar;<br>
}<br>
<br></blockquote><div><br></div><div>window.x3d should be nicer, as a dedicated namespace. x3dom uses the x3dom namespace.</div><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
and<br>
<br>
<Script ...>    <!-- X3D Script node --><br>
     function foo (event, time) {<br>
         window.bar = foo;<br>
     }<br>
</script><br>
<br></blockquote><div><br></div><div>This probably already works since cobweb evals the function text almost as is.</div><div><br></div><div>Is this the same as</div><div><br></div><div>var foo = function (event, time) {do_work;};</div><div>window.bar = foo;</div><div> ?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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);<br>
<br></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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.<br></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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.<br></blockquote><div><br></div><div>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 ?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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.<br></blockquote><div><br></div><div>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.</div><div><br></div><div>-Andreas</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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" rel="noreferrer" target="_blank">http://web3d.org/pipermail/<wbr>x3d-public_web3d.org/<wbr>attachments/20170810/93cc05ca/<wbr>attachment.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">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/<wbr>listinfo/x3d-public_web3d.org</a><br>
<br>
<br>
------------------------------<br>
<br>
End of x3d-public Digest, Vol 101, Issue 9<br>
******************************<wbr>************</blockquote></div><div><br></div>-- <br><div class="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div>