[x3d-public] Problem in x3dviewscene: ROUTE placement
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Sun Jun 11 14:32:53 PDT 2023
Hi Michalis - am surprised this is any surprise, but so it goes. There is
no "decision" to be made here, the X3D 4.0 Architecture is defined. Am
hoping to help with understanding and consistency in all variations of X3D.
Please see my recent note on this thread in response to Vince.
Regarding importance and examples, several responses. There are many in the
Web3D Example archives.
- Event-producing scene-graph blocks are much harder to
understand/diagnose/debug when ROUTE statements might be thousands of lines
away.
- I've found in class that students simply did not understand ROUTEs when
they were pushed to the end of the file.
- This sequencing has been allowed in X3D4 Architecture for a long time.
- The ClassicVRML97 grammar has similar counterparts in grammars defined by
X3D XML DOCTYPE and Schema, which do permit that.
- Personally I have found that the ability to put comments amidst
source/destination/ROUTE constructs is helpful too - indeed the "pretty
print" annotated HTML output applies that technique as author-assist
HMTL-linked documentation for every example too, confirming such utility to
authors.
My note "special locations related to Inline" was mistaken, sorry. The X3D
4.0 architecture states for both IMPORT and EXPORT that they can appear
anywhere in the file.
*
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Pa
rt01/components/networking.html#IMPORTStatement
*
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Pa
rt01/components/networking.html#EXPORTStatement
The examples I'm thinking of are in Web3D version control.
* X3D Resources, Examples: Scene Archives for X3D
*
https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
. for instance, here is an old and worthy one:
* X3D Example Archives: VRML 2 Sourcebook, Chapter 08 Animating
Position Orientation Scale, Figure 08 3 Position Interpolator
*
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter08Animatin
gPositionOrientationScale/Figure08_3PositionInterpolatorIndex.html
*
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter08Animatin
gPositionOrientationScale/Figure08_3PositionInterpolator.html
*
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter08Animatin
gPositionOrientationScale/Figure08_3PositionInterpolator.x3d
*
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter08Animatin
gPositionOrientationScale/Figure08_3PositionInterpolator.x3dv
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: Saturday, June 10, 2023 3:01 PM
To: vmarchetti at kshell.com
Cc: X3D-Public <x3d-public at web3d.org>; Brutzman, Donald (Don) (CIV)
<brutzman at nps.edu>
Subject: Re: [x3d-public] Problem in x3dviewscene: ROUTE placement
> BLUF: it is important and allowed for ROUTE statements (and prototype
statements) to appear in MFNode lists, side by side with other nodes.
Why? I don't see what would be the added value of allowing ROUTE statements
(or prototypes) in MFNode lists.
We had classic VRML specification saying that ROUTE statements are not
allowed in MFNode for many years, and all the X3D models I've seen so far
conform to this requirement -- the only exception being Joe model mentioned
in this thread.
> Not exactly sure what you mean by MFList.
Yeah, sorry -- I meant MFNode.
> IMPORT and EXPORT statements only appear in special locations related to
Inline node usage, and don't seem to need special mention in the prose
above.
Not sure what you mean here by "special locations related to Inline".
IMPORT and EXPORT can occur at the top-level of X3D. The grammar (
<https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.
html>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.h
tml
) doesn't "tie" them to Inline node in any way.
"""
statement ::=
nodeStatement |
importStatement |
exportStatement |
protoStatement |
routeStatement ;
"""
> We certainly have many hundreds of validated examples that include ROUTE
statements along with other children nodes, as part of MFNode lists. Large
parts of our existing infrastructure support this construct, in accordance
with X3D Architecture.
Where are these "hundreds of validated examples" that have ROUTEs inside
MFNode lists, in X3D classic encoding? I was testing view3dscene on a lot of
Web3d resources. I never seen so far a X3D classic file that has ROUTEs
inside MFNode lists -- except the Joe's model mentioned in this thread.
Regards,
Michalis
sob., 10 cze 2023 o 21:50 <mailto:vmarchetti at kshell.com>
vmarchetti at kshell.com < <mailto:vmarchetti at kshell.com>
vmarchetti at kshell.com> napisał(a):
>
>
>
> On Jun 10, 2023, at 2:04 PM, Brutzman, Donald (Don) (CIV) <
<mailto:brutzman at nps.edu> 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/gra>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/gra
> mmar.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
<mailto:brutzman at nps.edu> 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> https://faculty.nps.edu/brutzman
>
> -----Original Message-----
> From: Michalis Kamburelis < <mailto:michalis.kambi at gmail.com>
michalis.kambi at gmail.com>
> Sent: Friday, June 9, 2023 4:46 PM
> To: Brutzman, Donald (Don) (CIV) < <mailto:brutzman at nps.edu>
brutzman at nps.edu>
> Cc: Joseph D Williams < <mailto:joedwil at earthlink.net>
joedwil at earthlink.net>; X3D Graphics public
> mailing list < <mailto:x3d-public at web3d.org> x3d-public at web3d.org>;
<mailto:puk at igraphics.com> 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/gra>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/gra
> mmar.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) <
<mailto:brutzman at nps.edu> 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>
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/g>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/g
> > rammar.html
> >
> >
> >
> > Wikipedia: Extended Backus-Naur form (EBNF)
> > <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen>
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen
> > .wikipedia.org%2Fwiki%2FExtended_Backus-Naur_form&data=05%7C01%7Cbru
> > tzman%40nps.edu%7Cc987a5e90a694d917b8108db69fe4676%7C6d936231a51740e
> > a9199f7578963378e%7C0%7C0%7C638220313435712806%7CUnknown%7CTWFpbGZsb
> > 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> > D%7C2000%7C%7C%7C&sdata=Xf0JfdtLtWnVFum%2BfQsuatKrJogDaHlh2GnnK45hFG
> > A%3D&reserved=0
> >
> >
> > 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
<mailto:brutzman at nps.edu> 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> https://faculty.nps.edu/brutzman
> >
> >
> >
> > -----Original Message-----
> > From: Michalis Kamburelis < <mailto:michalis.kambi at gmail.com>
michalis.kambi at gmail.com>
> > Sent: Friday, June 9, 2023 2:11 PM
> > To: Joseph D Williams < <mailto:joedwil at earthlink.net>
joedwil at earthlink.net>
> > Cc: Brutzman, Donald (Don) (CIV) < <mailto:brutzman at nps.edu>
brutzman at nps.edu>; X3D Graphics
> > public mailing list < <mailto:x3d-public at web3d.org>
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/c>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/c
> > on
> > 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/g>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/g
> > ra
> > 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 <
<mailto:joedwil at earthlink.net> 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 < <mailto:x3d-public-bounces at web3d.org>
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 < <mailto:x3d-public at web3d.org>
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
> <mailto:x3d-public at web3d.org> x3d-public at web3d.org
> <http://web3d.org/mailman/listinfo/x3d-public_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/20230611/c90ffc89/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5464 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230611/c90ffc89/attachment-0001.p7s>
More information about the x3d-public
mailing list