[x3d-public] ProtoBody completeness in nested Protos

Andreas Plesch andreasplesch at gmail.com
Sun Apr 24 21:07:56 PDT 2022


ProtoDeclarations may use ProtoInstances of other Protos inside their
ProtoBody definitions.

For example, the CircleFishLod proto here:

https://x3dgraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodPrototypeIndex.html

uses ProtoInstances of the CircleFish proto.

A more extreme case of nesting is:

https://www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/PROTO/fivedeepnestingIndex.html

where Proto1 uses ProtoInstance of Proto2 inside its ProtoBody. Proto2
itself uses a ProtoInstance of Proto3 inside its ProtoBody. And so on
to five levels deep.

The second example with the deep nesting currently works with x3dom
but the seemingly simpler CircleFishLod proto does not.

The reason is that x3dom expects the complete definition of a proto to
be contained in its ProtoBody. However, The CircleFishLod proto only
contains the CircleFish ProtoInstances in the body but not the
associated CircleFish ProtoDeclaration which for some reason occurs
outside the CircleFishLod ProtoBody (and outside the CircleFishLod
ProtoDeclaration).

Expecting the ProtoBody to be complete and self-contained seems rather
natural. Is x3dom too strict in this regard, or is there an oversight
in the example ? There is not much guidance in the spec., if any.

Thanks, Andreas

-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list