[x3d-public] Finding more than one use of a DEF in VRML

John Carlson yottzumm at gmail.com
Thu Mar 26 08:50:28 PDT 2020


Doing a bit more searching:

https://www.web3d.org/x3d/content/X3dTooltips.html#ID

 "*ID <https://www.w3.org/TR/REC-xml/#sec-attribute-types>* is a NMTOKEN
that is unique within the scene, corresponding to the DEF attribute in X3D."



On Thu, Mar 26, 2020 at 10:34 AM John Carlson <yottzumm at gmail.com> wrote:

> I feel like an idiot.  I even read the specifications on this one and
> didn't get very far.
>
> On Thu, Mar 26, 2020 at 10:27 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Now I understand why I got all the blank stares when I suggested using a
>> symbol table for DEFs. To me, a DEF is like a var in ECMAScript.  I guess
>> DEF is more like id attribute in HTML5: double references are "allowed",
>> for some reason.
>>
>> Very confusing for someone coming from a standard programming language
>> like Java.
>>
>> Now i understand what you guys mean when you say ID/IDREF (at least the
>> first half).
>>
>> John
>>
>> On Thu, Mar 26, 2020 at 10:21 AM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Gotcha.
>>>
>>> On Thu, Mar 26, 2020 at 9:50 AM Michalis Kamburelis <
>>> michalis.kambi at gmail.com> wrote:
>>>
>>>> There isn't a "name" field general for all nodes. Some specific nodes
>>>> have "name" field, but it's specific to these nodes and their needs
>>>> (MetadataXxx, CADPart, CADLayer, HAnimHumanoid, HAnimJoint,
>>>> X3DVertexAttributeNode etc.). And it has special interpretation (e.g.
>>>> for X3DVertexAttributeNode this "name" is a shader per-vertex
>>>> attribute name).
>>>>
>>>> So when X3D specification (link you posted,
>>>>
>>>> https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#DEFL_USESemantics
>>>> ) talks about """Node names""" -> it means that names assigned using
>>>> DEF. Not names assigned using name="xxx"...
>>>>
>>>> Confusing, I know.
>>>>
>>>> It's an unfortunate collision of terms, the "name of X3D node" can
>>>> indeed be interpreted in various ways, depending on context. When
>>>> someone talks of a general X3D node, then they surely mean "name
>>>> assigned using DEF".
>>>>
>>>> Regards,
>>>> Michalis
>>>>
>>>> czw., 26 mar 2020 o 15:25 John Carlson <yottzumm at gmail.com> napisał(a):
>>>> >
>>>> > Maybe I'm confused.  Are node names
>>>> >
>>>> > name="node name"
>>>> >
>>>> > or
>>>> >
>>>> > DEF="node name"
>>>> >
>>>> > I've been using "DEF value" for "DEF keyword" I think.
>>>> >
>>>> > I think if the DEF keyword is not unique with in a scope, my
>>>> ProtoExpander will blow big chunks, but I'll have to check.
>>>> >
>>>> > There were many discussions on the mailing list about this, and maybe
>>>> I didn't understand because I wasn't phrasing the question properly.
>>>> >
>>>> > In some cases in the wrl previously reported, the DEF keyword is not
>>>> unique in the source file, but I didn't check for the source (that is, I
>>>> didn't inspect the source file very much), there could be additional scope
>>>> stuff like a PROTO.
>>>> >
>>>> > John
>>>> >
>>>> > On Thu, Mar 26, 2020 at 7:25 AM Michalis Kamburelis <
>>>> michalis.kambi at gmail.com> wrote:
>>>> >>
>>>> >> I have to correct myself -- I see x3d 3.3 specification says """Node
>>>> names shall be unique in the context within which the associated DEF
>>>> keyword occurs."""
>>>> >>
>>>> >> All right, that's good. Looks like this rule was improved at some
>>>> x3d version. That's good, it is a better idea to have all names unique
>>>> (e.g. for easy EXPORT).
>>>> >>
>>>> >> It still remains a question why did my converter generate repeated
>>>> DEF. It should not, if source VRML didn't repeat them. I'll look into it --
>>>> please send input to reproduce it:)
>>>> >>
>>>> >> Regards,
>>>> >> Michalis
>>>> >>
>>>> >> W dniu czw., 26.03.2020 o 12:09 Michalis Kamburelis <
>>>> michalis.kambi at gmail.com> napisał(a):
>>>> >>>
>>>> >>> As I mentioned in the other thread, multiple DEF with the same name
>>>> >>> are just allowed by the X3D specification. Last one "wins"
>>>> (obscuring
>>>> >>> the others with the same name). Maybe they should be disallowed or
>>>> >>> discouraged, it's another discussion. But right now they are allowed
>>>> >>> and proper VRML / X3D reader should understand them.
>>>> >>>
>>>> >>> As to why my exporter created them -- I need to see the relevant
>>>> input
>>>> >>> file to answer it. There should be a good reason for it :)
>>>> >>>
>>>> >>> Regards,
>>>> >>> Michalis
>>>> >>>
>>>> >>> czw., 26 mar 2020 o 06:30 John Carlson <yottzumm at gmail.com>
>>>> napisał(a):
>>>> >>> >
>>>> >>> > DEF/USE is how multiparent nodes are achieved, but all DEF and
>>>> USE with the same value are the same node, except for a few special cases.
>>>> >>> >
>>>> >>> > This is what one reason why HTML DOM is a poor choice...the nodes
>>>> have only one parent.
>>>> >>> >
>>>> >>> > Or I’m still battling windmills?
>>>> >>> >
>>>> >>> > John
>>>> >>> >
>>>> >>> > On Wed, Mar 25, 2020 at 10:16 PM GPU Group <gpugroup at gmail.com>
>>>> wrote:
>>>> >>> >>
>>>> >>> >> double defining:
>>>> >>> >> - this stymied me too, until I realized the DEF/USE are just for
>>>> the parser, and its the sequence that counts although different for
>>>> different browsers.
>>>> >>> >> - if you redef 3 times, then USE, what will you get?
>>>> >>> >> - that depends on the web3d browser, with some sticking to the
>>>> first DEF, some the last DEF.
>>>> >>> >>
>>>> >>> >> On Wed, Mar 25, 2020 at 9:01 PM John Carlson <yottzumm at gmail.com>
>>>> wrote:
>>>> >>> >>>
>>>> >>> >>> If one DEF specified a shape and another DEF with the same
>>>> value with a different shape, wouldn't the 2 browsers show different shapes
>>>> if they picked different DEFs?
>>>> >>> >>>
>>>> >>> >>> I don't think double DEFs should be allowed within the same
>>>> namespace.
>>>> >>> >>>
>>>> >>> >>> John
>>>> >>> >>>
>>>> >>> >>> On Wed, Mar 25, 2020 at 9:12 PM GPU Group <gpugroup at gmail.com>
>>>> wrote:
>>>> >>> >>>>
>>>> >>> >>>> Chisel? "it was simply put in the public domain by Trapezium
>>>> when they folded many years ago. They didn¹t specify any license" - Louka
>>>> >>> >>>> http://dug9.users.sourceforge.net/web3d/temp/chisel-src.zip
>>>> >>> >>>> But I suspect double-deffing isn't illegal. I think I've been
>>>> through it, and different browsers honored the first or last definition.
>>>> >>> >>>> -Doug
>>>> >>> >>>>
>>>> >>> >>>> On Wed, Mar 25, 2020 at 7:43 PM John Carlson <
>>>> yottzumm at gmail.com> wrote:
>>>> >>> >>>>>
>>>> >>> >>>>> That is, more than one DEF with the same value.
>>>> >>> >>>>>
>>>> >>> >>>>> I realize that separate PROTOs may have the same DEF due to
>>>> namespaces.   Unfortunately writing a Unix script to find this takes
>>>> massive brain power.
>>>> >>> >>>>>
>>>> >>> >>>>> John
>>>> >>> >>>>>
>>>> >>> >>>>> On Wed, Mar 25, 2020 at 8:37 PM John Carlson <
>>>> yottzumm at gmail.com> wrote:
>>>> >>> >>>>>>
>>>> >>> >>>>>> I’m not particular looking for a vrml parser unless it
>>>> catches double use of a DEF.
>>>> >>> >>>>>>
>>>> >>> >>>>>> Thanks,
>>>> >>> >>>>>>
>>>> >>> >>>>>> John
>>>> >>> >>>>>>
>>>> >>> >>>>>> I’m thinking my next project might be a VRML validator if
>>>> there isn’t one handy?  Anyone?
>>>> >>> >>>>>>
>>>> >>> >>>>>> I know I can translate VRML to XML.
>>>> >>> >>>>>>
>>>> >>> >>>>>> John
>>>> >>> >>>>>>
>>>> >>> >>>>>> On Wed, Mar 25, 2020 at 3:38 PM John Carlson <
>>>> yottzumm at gmail.com> wrote:
>>>> >>> >>>>>>>
>>>> >>> >>>>>>> Say, where is a VRML Validator? !!!!
>>>> >>> >>>>>>>
>>>> >>> >>>>>>> On Wed, Mar 25, 2020 at 3:33 PM John Carlson <
>>>> yottzumm at gmail.com> wrote:
>>>> >>> >>>>>>>>
>>>> >>> >>>>>>>> I will download X3D-Edit and do some validation on the
>>>> files, or go to the validation site @ savage
>>>> >>> >>>>>
>>>> >>> >>>>> _______________________________________________
>>>> >>> >>>>> x3d-public mailing list
>>>> >>> >>>>> x3d-public at web3d.org
>>>> >>> >>>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>> >>> >>>>
>>>> >>> >>>> _______________________________________________
>>>> >>> >>>> x3d-public mailing list
>>>> >>> >>>> x3d-public at web3d.org
>>>> >>> >>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>> >>> >
>>>> >>> > _______________________________________________
>>>> >>> > 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/20200326/fffd0a97/attachment.html>


More information about the x3d-public mailing list