[x3d-public] review of various X3D statement implementations for X3DOM

Leonard Daly Leonard.Daly at realism.com
Wed Dec 20 08:33:42 PST 2017


Michalis states the spec correctly wrt DEF/USE and node reuse. X3DOM is 
operating in the HTML5 environment. HTML5 prohibits an element with 
multiple parents, so the X3D node cannot be inserted into the HTML5 
document; however, it can be multiply-parented in the scene graph as 
that is not part of the DOM.

Leonard Daly


> 2017-12-20 15:51 GMT+01:00 Andreas Plesch <andreasplesch at gmail.com>:
>> (DEF/USE in x3dom: There are a several x3dom issues about picking a
>> USE Shape. Since x3dom literally places the referenced DEF Shape in
>> the scene graph, the picking actually reports the node of the
>> referenced DEF Shape when the USE Shape is picked. This is because
>> x3dom actually does not keep a distinct representation of the USE node
>> at all. Except for the fact that the DEF node now has two parents.
>> This may be too literal an interpretation of the DEF/USE concept, and
>> I wonder if in the spec. there is a section which explains how the
>> node which has a USE reference is still a distinct node. I suspect
>> that keeping such a distinct node around is how most x3d browsers work
>> ?
> This DEF / USE (in x3dom) treatment is required by the X3D
> specification, and it (should) be the same in all VRML / X3D browsers.
> I know it is the same in view3dscene and Castle Game Engine. When we
> encounter a "USE Xxx" then internally we *do not* make a copy of the
> "Xxx" node, instead we make an additional link to the "Xxx" node that
> in effect has 2 parents. This implementation is most natural and
> practically required by the X3D specification:
>
> http://www.web3d.org/documents/specifications/19775-1/V3.2/Part01/concepts.html#DEFL_USESemantics
>
> """
> The USE statement does not create a copy of the node. Instead, the
> same node is inserted into the scene graph a second time, resulting in
> the node having multiple parents (see 4.3.5 Transformation hierarchy,
> for restrictions on self-referential nodes).
> """
>
> And that's a very good concept, in my opinion: it allows to use DEF /
> USE mechanism for various optimizations. Since you have only one copy
> of the node, you should also be able to have only one copy of various
> internal things (like OpenGL VBO data) associated e.g. with Shape that
> is USEd multiple times. This is really powerful, you can construct a
> large scene by USEing the same shapes multiple times, and it will
> still render fast and not eat too much memory:)
>
> In contrast, expanding the PROTOtypes makes a copy on the contents.
>
> Regards,
> Michalis
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>

-- 
*Leonard Daly*
3D Systems & Cloud Consultant
LA ACM SIGGRAPH Past Chair
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171220/f7760e3f/attachment.html>


More information about the x3d-public mailing list