[x3d-public] cobweb DOM integration

Andreas Plesch andreasplesch at gmail.com
Sun Oct 9 19:35:09 PDT 2016


Hi,

following up on adding support for sensors in inlines, I also added support
for sensor which were added to an initial scene:

https://andreasplesch.github.io/cobweb_dom/tests/cobweb_d3.xhtml

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'.

This also required support for adding nodes which are ChildNodes of
grouping nodes, and not root nodes.

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.

If there is containerField attribute, one can just use its value as the
field name of the parent node to be set.

Otherwise, use the node name as the field name ? Works for Material and
many other nodes but does not work for Box, for example.
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) ?
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.

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 ?

Any ideas or feedback welcome,

-Andreas




On Sun, Oct 9, 2016 at 7:22 PM, Andreas Plesch <andreasplesch at gmail.com>
wrote:

> Hi list, Holger,
>
> I worked on reproducing this x3dom inline example:
>
> http://examples.x3dom.org/example/x3dom_inlineReflection.xhtml
>
> with cobweb_dom:
>
> https://andreasplesch.github.io/cobweb_dom/tests/inline_
> reflection/cobwebdom_inlineReflection.xhtml
>
> 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.
> 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.
>
> 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.
>
> I think this completes work on dom integration of inline. Next I want to
> look into better support of adding non-root nodes.
>
> -Andreas
>
> --
> Andreas Plesch
> 39 Barbara Rd.
> Waltham, MA 02453
>



-- 
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20161009/d3fc76e0/attachment.html>


More information about the x3d-public mailing list