[x3d-public] More than one DEF with same value

GPU Group gpugroup at gmail.com
Tue May 19 12:25:49 PDT 2020


in freewrl, DEF strings aren't stored in the node, they are added to a
lookup table (DEF,node) (string, binaryNode) during parsing.
When the parser hits an xml node definition, if there's a USE, it goes
through the lookup table to see if there's a node already defined, and if
so it plops a binary reference to that node into the scenegraph and ignores
the rest of the xml USE declaration.
If it gets another DEF with the same name while parsing, it
a) replaces  the previous (name,node) tuple OR
b) adds to end of list a new (DEF,node) tuple
(I don't remember which)
So next USE it looks up the name in the table.
- I think different browsers iterate over the list / do the lookup
different ways,
- IIRC flux will stick with the first (DEF,node)
- and freewrl will stick with the last (DEF,node)
-Doug



On Tue, May 19, 2020 at 11:10 AM John Carlson <yottzumm at gmail.com> wrote:

> Here’s my understanding of DEFed nodes.   DEF creates one more parent node
> similar to USE, but another DEF with same value allows update or addition
> of fields of the multiply mentioned node, where USE does not.
>
> DEF nodes with the same DEF value may appear more than once in XML.
>
> Okay?
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200519/4031152c/attachment.html>


More information about the x3d-public mailing list