[x3d-public] Problem in x3dviewscene: ROUTE placement

Michalis Kamburelis michalis.kambi at gmail.com
Sun Jun 11 14:29:55 PDT 2023


Don,

To be clear, allowing ROUTE in node definition is fully OK and is
indeed common practice. And it is allowed by spec already.

The issue is about allowing ROUTE in MFNode contents (in X3D classic
encoding), so that one can write "Group { children [ ROUTE ... ] }".

- I don't see it as common practice -- I didn't see so far any X3D
model using it, except the Joe's model mentioned in this thread.

- It is clearly not allowed by existing X3D classic encoding spec, and
I believe that was a good decision, it makes MFNode grammar natural.

- If there's a whole lot of existing models already depending on this
feature, that would surely be a convincing argument, please point me
to them. You mentioned "hundreds of validated examples that include
ROUTE statements along with other children nodes, as part of MFNode
lists" -- I honestly didn't see them, and I checked a lot of Web3d
models. Can you point me to these models?

Regards,
Michalis

niedz., 11 cze 2023 o 23:09 Brutzman, Donald (Don) (CIV)
<brutzman at nps.edu> napisał(a):
>
> Not trying to invent anything here, rather point out what is specified (and also common practice).  I already gave the relevant links in the X3D 4.0 Architecture governing what is required.  Two editorial highlights were suggested as additions to spec prose in another section to avoid any ambiguity and aid clarity.  If we decide not to add them (when eventually allowed by ISO rules) that has no effect on the functional descriptions already provided.
>
>
>
> As we proceed through each of the other (many) specifications and upgrade them from X3D 3.2/3.3 to X3D 4.0, similar refinements may prove to be necessary.  Consistency across all file encodings and language bindings is possible.  If we find a change to the grammar is needed to match, the Architecture remains the governing authoritative reference.
>
>
>
> Please note that no change to 3.2/3.3 versions, nor any disservice to authors and developers, is planned or proposed here.
>
>
>
> Building on your statement about validators: if any validators are incorrectly flagging as errors any scene definitions that are not errors, that is a validator issue too.
>
>
>
> Perhaps worth noting here is that no one has indicated that the precise flexibility of ROUTE placement within node definitions, as defined in X3D Architecture for quite a while, leads to any ambiguity or error in the resulting scene graphs.
>
>
>
> Hope this helps.
>
>
>
> all the best, Don
>
> --
>
> Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu
>
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman
>
>
>
> From: vmarchetti at kshell.com <vmarchetti at kshell.com>
> Sent: Saturday, June 10, 2023 12:51 PM
> To: X3D-Public <x3d-public at web3d.org>
> Cc: Michalis Kamburelis <michalis.kambi at gmail.com>; Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
> Subject: Re: [x3d-public] Problem in x3dviewscene: ROUTE placement
>
>
>
> On Jun 10, 2023, at 2:04 PM, Brutzman, Donald (Don) (CIV) <brutzman at nps.edu> wrote:
>
>
>
> Well, closer, but not quite there yet.  Here is some more “language lawyering.”  8)
>
>
>
> BLUF: it is important and allowed for ROUTE statements (and prototype statements) to appear in MFNode lists, side by side with other nodes.
>
>
>
> I don't judge this this principle is stated the X3D standard.  I don't agree that the standard should be edited to make it conform to this principle. The original architects of VRML, later evolved into X3D, introduced the concepts of 'statements' and of nodes, and chose to make the function of connection between diffent parts of a scene graph (which is a hierchical structure of nodes ) defined by ROUTE statements.
>
>
>
> If the standard were to be edited to explicitly conform to this principle, we would also need to modify the formal grammar for ClassicVRML encoding
>
>
>
>  https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.html
>
>
>
> In this grammer are definitions:
>
>
>
> nodeStatement ::=
>
> node |
>
> DEF nodeNameId node |
>
> USE nodeNameId ;
>
> ...
>
> nodeStatements ::=
>
> nodeStatement |
>
> nodeStatement nodeStatements ;
>
> mfnodeValue ::=
>
> nodeStatement |
>
> [ ] |
>
> [ nodeStatements ] ;
>
>
>
> The mfnodeValue grammar would need to have routeStatement added, and the theological questions about whether an MFNode can have only ROUTE statements resolved.
>
>
>
> I think it would be a disservice to our developers to make changes in the formal grammar of our Classic VRML encoding in this way. If there are examples of X3D in Classic VRML encodings with this structure which are not being caught by validators, then that is an issue for the validators.
>
>
>
> Vince Marchetti
>
>
>
>
>
>
>
>
>
>
>
> all the best, Don
>
> --
>
> Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu
>
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman
>
>
>
> -----Original Message-----
> From: Michalis Kamburelis <michalis.kambi at gmail.com>
> Sent: Friday, June 9, 2023 4:46 PM
> To: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
> Cc: Joseph D Williams <joedwil at earthlink.net>; X3D Graphics public mailing list <x3d-public at web3d.org>; puk at igraphics.com
> Subject: Re: [x3d-public] Problem in x3dviewscene: ROUTE placement
>
>
>
> I do not see any need to change the X3D spec here. For once, it is all correct in X3D spec  :) And "Architecture and base components" is consistent with what "Classic VRML encoding" is saying, and both chapters of "Classic VRML encoding" ("4 Concepts" and "Annex A
>
> (normative) Grammar") are consistent.
>
>
>
> Joe's model should just be fixed, from what I can tell -- you have to move ROUTE outside of the [ ... ]. It makes sense that MFList [ ... ] should contain only nodes.
>
>
>
> From what I can tell,
>
> https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.html
>
> clearly says that ROUTE cannot be part of MFList [ ... ] , and that's OK. You have to place ROUTE within some node (or at top-level).
>
>
>
> Within MFList [ ... ] you can only have nodes (or USE of nodes). You cannot place ROUTE, EXPORT, IMPORT, PROTO... within MFList [ ... ] and that's OK, that's simple. Let's not break it :)
>
>
>
> Regards,
>
> Michalis
>
>
>
> sob., 10 cze 2023 o 01:30 Brutzman, Donald (Don) (CIV) <brutzman at nps.edu> napisał(a):
>
> >
>
> > Thanks for precise response Michalis, very helpful.
>
> >
>
> > The intent for ROUTE is that it might appear within other nodes.  The phrasing in X3D4 Architecture is quite explicit about this:
>
> >
>
> > X3D 4.0 Part 1: Architecture and base components, clause 4 Concepts,
>
> > 4.4.8.2 Routes
>
> > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.pr
>
> > oof/Part01/concepts.html#Routes Routes allows an author to
>
> > declaratively connect the output events of a node to input events of other nodes, providing a way to implement complex behaviors without imperative programming. When a routed output event is fired, the corresponding destination input event receives notification and can process a response to that change. This processing can change the state of the node, generate additional events, or change the structure of the scene graph. Routes may be created declaratively in an X3D file or programmatically via an SAI call.
>
> > Routes are not nodes. The ROUTE statement is a construct for establishing event paths between specified fields of nodes. ROUTE statements may either appear at the top level of an X3D file or inside a node wherever fields may appear. A ROUTE statement shall only appear after the definition of the source and destination nodes. Placing a ROUTE statement within a node does not associate it with that node in any way. A ROUTE statement does follow the name scoping rules as described in 4.4.7 Run-time name scope.
>
> >
>
> > We expect that the prose and grammar in 19776-2/V3.3 Part 2: Classic VRML encoding to be reviewed and refined to match, when we get back to that document and upgrade it to X3D 4.0.  I think that the current ClassicVRML spec indeed defers to the Architecture specification:
>
> >
>
> > X3D 3.3 Part 2: Classic VRML encoding, clause 4 Concepts, 4.3.2
>
> > Statements, 4.3.2.1 Organization of statements “Any number of ROUTE statements as specified in 4.4.8.2 Routes of ISO/IEC 19775-1.”
>
> >
>
> > So changes (corresponding to your accurate note) may need to be made to
>
> >
>
> > X3D 3.3 Part 2: Classic VRML encoding, Annex A (normative), Grammar
>
> > https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.html
>
> >
>
> >
>
> >
>
> > Wikipedia: Extended Backus–Naur form (EBNF)
>
> > https://en.wikipedia.org/wiki/Extended_Backus-Naur_form
>
> >
>
> >
>
> > which includes the following EBNF production rules:
>
> >
>
> >
>
> >
>
> > node ::=
>
> >
>
> > nodeTypeId { nodeBody } |
>
> >
>
> > Script { scriptBody } |
>
> >
>
> > ComposedShader {composedShaderBody} |
>
> > PackagedShader {packagedShaderBody} |
>
> > ShaderProgram {shaderProgramBody} ;
>
> >
>
> > nodeBody ::=
>
> >
>
> > nodeBodyElement |
>
> >
>
> > nodeBodyElement nodeBody |
>
> >
>
> > empty ;
>
> >
>
> > nodeBodyElement ::=
>
> >
>
> > initializeOnlyId fieldValue |
>
> > inputOutputId fieldValue |
>
> >
>
> > initializeOnlyId IS initializeOnlyId |
>
> >
>
> > inputOnlyId IS inputOnlyId |
>
> >
>
> > outputOnlyId IS outputOnlyId |
>
> >
>
> > inputOutputId IS inputOutputId |
>
> >
>
> > routeStatement |
>
> >
>
> > protoStatement ;
>
> >
>
> > and
>
> >
>
> > routeStatement ::=
>
> >
>
> > ROUTE nodeNameId . outputOnlyId TO nodeNameId . inputOnlyId ;
>
> >
>
> >
>
> >
>
> > which, at first glance, looks OK to me from perspective of Joe’s
>
> > example (and many other examples)…
>
> >
>
> >
>
> >
>
> > Do you have modifications to suggest for the grammar?
>
> >
>
> >
>
> >
>
> > p.s. I tried to add a Mantis issue for long-term tracking but had trouble getting form to respond properly, will try again another time.
>
> >
>
> > Ensure ClassicVRML grammar matches X3D 4.0 Architecture Concepts and rules.
>
> > In particular, closely examine placement of ROUTE statements.
>
> >
>
> >
>
> >
>
> > all the best, Don
>
> >
>
> > --
>
> >
>
> > Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu
>
> >
>
> > Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149
>
> >
>
> > X3D graphics, virtual worlds, navy robotics
>
> > https://faculty.nps.edu/brutzman
>
> >
>
> >
>
> >
>
> > -----Original Message-----
>
> > From: Michalis Kamburelis <michalis.kambi at gmail.com>
>
> > Sent: Friday, June 9, 2023 2:11 PM
>
> > To: Joseph D Williams <joedwil at earthlink.net>
>
> > Cc: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics
>
> > public mailing list <x3d-public at web3d.org>
>
> > Subject: Re: [x3d-public] Problem in x3dviewscene: ROUTE placement
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > The ROUTE cannot go anywhere in the file, in particular you cannot place it inside an MFNode.
>
> >
>
> >
>
> >
>
> > https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/con
>
> > cepts.html
>
> >
>
> > : ROUTE is allowed at top-level and in node's body,
>
> >
>
> >
>
> >
>
> > """
>
> >
>
> > A node's body consists of any number of field statements, IS statements, ROUTE statements, PROTO statements or EXTERNPROTO statements, in any order.
>
> >
>
> > """
>
> >
>
> >
>
> >
>
> > The grammar confirms this precisely:
>
> >
>
> >
>
> >
>
> > https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/gra
>
> > mmar.html
>
> >
>
> > :
>
> >
>
> >
>
> >
>
> > - mfnodeValue is a sequence of nodeStatement
>
> >
>
> > - nodeStatement is only "USE ...", "DEF Xxx Node { }" or "Node { }"
>
> >
>
> > - only the more general "statement" allows ROUTE (and IMPORT, EXPORT, PROTO...). The "statement" is inside a node (but not in MFNode list).
>
> >
>
> >
>
> >
>
> > Regards,
>
> >
>
> > Michalis
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > pt., 9 cze 2023 o 22:37 Joseph D Williams <joedwil at earthlink.net> napisał(a):
>
> >
>
> > >
>
> >
>
> > > Hi All,
>
> >
>
> > >
>
> >
>
> > > My problem with view3dscene 4.3.0 is that it quits reading upon this sequence:
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > DEF StandAnimation Group {
>
> >
>
> > >
>
> >
>
> > > children [
>
> >
>
> > >
>
> >
>
> > > DEF StandTimer TimeSensor { … }
>
> >
>
> > >
>
> >
>
> > > DEF Stand_r_metatarsalPitch OrientationInterpolator {
>
> >
>
> > >
>
> >
>
> > >   key [ … ]
>
> >
>
> > >
>
> >
>
> > >   keyValue [ ... ]} ...
>
> >
>
> > >
>
> >
>
> > > ROUTE StandTimer.fraction_changed TO
>
> >
>
> > > Stand_r_ankleRotInterp.set_fraction
>
> >
>
> > >
>
> >
>
> > > ]}
>
> >
>
> > >
>
> >
>
> > > …
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > When it finds a ROUTE as child of Group. The error is:
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > VRML/X3D: Error when reading, will skip the rest of X3D file:
>
> >
>
> > >
>
> >
>
> > > Error at line 661 column 6:
>
> >
>
> > >
>
> >
>
> > > Expected node type or DEF or USE, got keyword "ROUTE"
>
> >
>
> > >
>
> >
>
> > > Making this construction required.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > DEF StandAnimation Group {
>
> >
>
> > >
>
> >
>
> > > children [
>
> >
>
> > >
>
> >
>
> > > DEF StandTimer TimeSensor { … }
>
> >
>
> > >
>
> >
>
> > > DEF Stand_r_metatarsalPitch OrientationInterpolator {
>
> >
>
> > >
>
> >
>
> > >   key [ … ]
>
> >
>
> > >
>
> >
>
> > >   keyValue [ ... ]} ...
>
> >
>
> > >
>
> >
>
> > > ]}
>
> >
>
> > >
>
> >
>
> > > ROUTE StandTimer.fraction_changed TO
>
> >
>
> > > Stand_r_ankleRotInterp.set_fraction
>
> >
>
> > >
>
> >
>
> > > …
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Moving the Route outside the Group.
>
> >
>
> > >
>
> >
>
> > > I think we went through the gram in detail here and found that placing the statement in this MF should be OK.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Thanks,
>
> >
>
> > >
>
> >
>
> > > Joe
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Clipped for mercy
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > From: x3d-public <x3d-public-bounces at web3d.org> On Behalf Of Joseph
>
> > > D
>
> >
>
> > > Williams
>
> >
>
> > > Sent: Friday, June 9, 2023 10:29 AM
>
> >
>
> > > To: X3D Graphics public mailing list <x3d-public at web3d.org>
>
> >
>
> > > Subject: [x3d-public] Problem in x3dviewscene: ROUTE placement
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Error in viewX3dScene processing
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > VRML/X3D: Error when reading, will skip the rest of X3D file: Error at line 661 column 6: Expected node type or DEF or USE, got keyword "ROUTE"
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > I was hoping we could fix this player problem since we determined that a ROUTE statement can go anywhere in the file.
>
> >
>
> > >
>
> >
>
> > > Thanks,
>
> >
>
> > >
>
> >
>
> > > Joe
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>



More information about the x3d-public mailing list