[x3d-public] Problem in x3dviewscene: ROUTE placement

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Fri Jun 9 16:30:04 PDT 2023


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.proof/Pa
rt01/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.h
tml

 

*	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/concepts
.html>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/concepts.
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/grammar.
html>
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.h
tml

:

 

- 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

> 

> 

> 

> 

> 

> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230609/f01b9e03/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/20230609/f01b9e03/attachment-0001.p7s>


More information about the x3d-public mailing list