[x3d-public] first Viewpoint in Inline and binding delays

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sun Oct 13 20:20:35 PDT 2019

On 10/13/2019 7:17 PM, Andreas Plesch wrote:
> Section 7.2.2 point d)
> (https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/core.html#BindableChildrenNodes)
> spells out that a Viewpoint in an Inline cannot become the first bound
> Viewpoint, in any situation, even if the main scene does not contain a
> Viewpoint node itself.

specifically the spec says:

"The following rules describe the behaviour of the binding stack for a node of type <bindable node>, (Background, TextureBackground, Fog, NavigationInfo, or Viewpoint):

[d.] During read, the first encountered <bindable node> in each layer is bound by pushing it to the top of the <bindable node> stack for that layer. Nodes contained within files referenced by Inline nodes, within the strings passed to the Browser.createX3DFromString() method, or within X3D files passed to the Browser.createX3DFromURL() method (see Part 2 of ISO/IEC 19775) are not candidates for the first encountered <bindable node>. The first node within a locally defined prototype instance is a valid candidate for the first encountered <bindable node>. The first encountered <bindable node> sends an isBound TRUE event."

> This rule makes it impractical to use the construct of a simple
> container scene which only has a single Inline node which then has the
> actual content including an appropriate first Viewpoint. Such a
> construct can be really useful.
> What is the rationale behind that rule ? Probably I am overlooking
> something but I cannot immediately recognize the underlying reasoning.
> Thanks, -Andreas

You make a good case here Andreas.  Not seeing a strong reason why not... I think the original rationale might have been that the order of loading from multiple Inline nodes was nondeterministic due to potential variations in network loading delays for Inline url content.

Am thinking/agreeing we need to allow Inline or Browser.createFrom* binding if no other nodes are on the relevant binding stack.  Suggested change:

	"[...] are not candidates for the first encountered <bindable node>."
	"[...] are not candidates for the first encountered <bindable node>, unless the respective stack is empty."

What do you and others think, is that sufficient?

We might also allow browsers to defer binding until all loading is complete within a current network-timeout interval, as way to prevent unpredictable Viewpoint popping/rebinding when multiple Inline nodes are getting retrieved.  Similarly account for time delays might be appropriate a Script or a ProtoInstance generating new content.

Next, going further: although network delays might be variable, the order of occurrence can certainly be deterministic once loading is complete.  Seems like we will need prose that states the order of nodes added by prototypes or Inline nodes in the run-time scene graph (whether native X3D or in DOM) needs to match the order of definition.  This would allow authors to deterministically define the order of nodes in the render graph and in the binding stacks.  That is preferable to allowing browsers to append nodes in a somewhat random order according to time of arrival.

Example use case: models that contain higher-detailed geometry and Viewpoints for rooms in a house should present those viewpoints in the order that they are defined.  In that way, viewpoints for higher Inline detail for a given room appear together in the viewpoint list, rather than the viewpoint list becoming a mixed-up hodgepodge that thwarts sensible user navigation.

First draft suggested prose in that direction, which can no doubt be improved:

	"New nodes can be added to a scene as a result of Inline, prototype instance or Script activity.
	 The resultant ordering of run-time nodes is deterministic based on addition to current scene-graph order, regardless of time delays during loading or generation.
	 This means that the resulting order of nodes matches the precise order defined by the original and the added content.
	 If appropriate, browsers are allowed to defer activation changes on the current binding stacks until current content loading is complete or a network timeout occurs."

Improvements welcome.

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 http://faculty.nps.edu/brutzman

More information about the x3d-public mailing list