<div dir="ltr"><div><div><div><div><div><div>Version 0.4 of cobweb_dom.js is now available. It adds support for accessing inlined scenes, allows for multiple scenes on a single web page, and has better (good?) support for adding non-root nodes. Also all examples are updated to use this release and the newest cobweb.js .<br><br></div>I want to look into Routes and Interpolators next.<br><br></div>One related question is if and how to relay events from x3d to the dom (never back, I think). One idea is to generalize how sensor events are triggering custom dom events named after the field name and with an event value payload.<br><br></div>This could mean to attach fieldcallbacks to all [in,out] and [out] fields of most(all?) nodes which then dispatch the custom dom events. In turn, in the dom, event listeners can be added to any node by user code, and react to the out events. I am concerned that a lot of custom dom events would be zipping around.<br><br></div>What might be other concerns ?<br><br>This x3dom example triggered this idea:<br><br>view-source:<a href="http://doc.x3dom.org/tutorials/animationInteraction/onoutputchange/example.html">http://doc.x3dom.org/tutorials/animationInteraction/onoutputchange/example.html</a><br><br></div>With interpolators the goal would be to able to listen to a value_changed dom event and then do something with it. <br><br></div>Are there strange scenarios where reacting to an field_changed (out) event outside of the x3d event cascade may cause (perhaps catastrophic) trouble ?<br><div><br></div><div>-Andreas<br></div><div><div><div><div><div><div><br><div><div class="gmail_extra"><div class="gmail_quote">On Sun, Oct 9, 2016 at 10:35 PM, Andreas Plesch <span dir="ltr"><<a target="_blank" href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div><div>Hi,<br><br></div><div>following up on adding support for sensors in inlines, I also added support for sensor which were added to an initial scene:<br></div><div><br></div><a target="_blank" href="https://andreasplesch.github.io/cobweb_dom/tests/cobweb_d3.xhtml">https://andreasplesch.github.i<wbr>o/cobweb_dom/tests/cobweb_d3.x<wbr>html</a><br><br></div><div>The toggle box sensor adds and removes a TouchSensor to the last box added, and then adds an event handler to change the color of the box when 'touched'.<br><br></div><div>This also required support for adding nodes which are ChildNodes of grouping nodes, and not root nodes.<br><br></div><div>Now, in addition to ChildNodes I would like to add other nodes which are not root nodes, eg. field values of parent nodes. This requires determining which field of a parent node should be set, and I am looking for a good strategy to make this determination.<br><br></div><div>If there is containerField attribute, one can just use its value as the field name of the parent node to be set.<br><br></div><div>Otherwise, use the node name as the field name ? Works for Material and many other nodes but does not work for Box, for example.<br></div><div>It is probably possible to make a big map of which nodes can be values of which fields. Is there such an explicit map (other than implicit in the XML schema) ?<br></div><div>Using this map, it would be possible to look up he field(s) a node can be the value of and then check and set the appropriate parent's field, if any.<br><br></div><div>What are other strategies for determining the field in a container node which should (most likely) be set given just the identity of a new node and its containing (parent) node ?<br><br></div><div>Any ideas or feedback welcome,<br><br></div><div>-Andreas<br></div><div> <br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 9, 2016 at 7:22 PM, Andreas Plesch <span dir="ltr"><<a target="_blank" href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><p dir="ltr">Hi list, Holger,</p>
<p dir="ltr">I worked on reproducing this x3dom inline example:</p>
<p dir="ltr"><a target="_blank" href="http://examples.x3dom.org/example/x3dom_inlineReflection.xhtml">http://examples.x3dom.org/exam<wbr>ple/x3dom_inlineReflection.<wbr>xhtml</a></p>
<p dir="ltr">with cobweb_dom:</p>
<p dir="ltr"><a target="_blank" href="https://andreasplesch.github.io/cobweb_dom/tests/inline_reflection/cobwebdom_inlineReflection.xhtml">https://andreasplesch.github.i<wbr>o/cobweb_dom/tests/inline_refl<wbr>ection/cobwebdom_inlineReflect<wbr>ion.xhtml</a></p>
<p dir="ltr">This required adding support for multiple scenes on a single web page, and adding support for relaying sensor events to dom events from within inlines.<br>
Also, there is now a x3dload Event dispatched to signal when all inlines are loaded into the dom. This is necessary for user code to know when it is possible to access inlined elements.</p>
<p dir="ltr">The main difference between x3dom and cobweb user code is still that listeners need to be added with addEventListener rather than using a onevent attribute and that actual TouchSensor nodes are required.</p>
<p dir="ltr">I think this completes work on dom integration of inline. Next I want to look into better support of adding non-root nodes.</p><span class="gmail-m_-4078576944145984425HOEnZb"><font color="#888888">
<p dir="ltr">-Andreas </p><span class="gmail-HOEnZb"><font color="#888888">
<p dir="ltr">-- <br>
Andreas Plesch<br>
39 Barbara Rd.<br>
Waltham, MA 02453</p>
</font></span></font></span></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="gmail-m_-4078576944145984425gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div></div></div></div></div></div></div></div>