[x3d-public] Understanding of IS connect for xml...issue for JSON encoding.

Don Brutzman brutzman at nps.edu
Fri Jul 1 06:47:24 PDT 2016


On 6/30/2016 8:40 PM, John Carlson wrote:
> My understanding of IS connect is as follows.  For Script nodes, the nodeField refers to a field "name" attribute value.  For regular nodes, the nodeField is an attribute name.

There is no real difference between Script and other regular nodes in this respect.  Script simply has the flexibility for defining it's own fields.

Thus the fields of a Script can be directly connected to the field definitions of a parent ProtoDeclare via IS/connect.

>  Any other gotchas?  Does ProtoInstance take an IS node?

ProtoDeclare is similar to Script in that it can define it's own fields, as well as its own name and body.

Note that IS/connect enables you to directly pass values between a ProtoDeclare/ProtoInterface/field definitions and the fields of contained nodes in the ProtoBody without needing a ROUTE.

The connected ProtoBody nodes might be regular nodes, Scripts, or even ProtoInstance.

Nested prototypes (ProtoDeclares and/or ProtoInstances inside a ProtoBody) are not very common but they are allowed by the X3D specification.

> If the distinction between field and attribute is not there in VRML (is it?), why do we have it in the JSON encoding?  Does it lead to better validation of files?

XML attributes are the same as X3D fields having simple types (i.e. anything but SFNode/MFNode).

The same scene graph can be consistently represented in VRML and X3D, which includes XML, ClassicVRML, compressed binary, and JSON encodings.

XML and JSON encodings can describe the same scene graph, but have the additional merit of validation mechanisms to check that the content is OK.  Their ability to check content validity is not symmetric, but always helpful.

If we find further differences in the JSON encoding that don't capture the same scene graph, then we need to improve the JSON encoding design wherever possible.

References of interest for IS/connect follow.

see ProtoDeclare, ProtoInterface, ProtoBody, field, ProtoInstance, fieldValue, Script:

	X3D Tooltips
	http://www.web3d.org/x3d/content/X3dTooltips.html

X3D for Web Authors
	Chapter  9 Scripts
	Chapter 14 Prototypes

	http://X3Dgraphics.com
	Book, slides, examples

X3D Specification
	Script
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/scripting.html#Script

	Prototypes
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/core.html

The X3D Validator has many tests to confirm the correctness of IS/connect in the XML encoding.  Hard to make a mistake with that looking over your shoulder.  This is why our 3000+ examples in version control use the XML encoding.

	https://savage.nps.edu/X3D-Edit/

	http://www.web3d.org/x3d/content/examples/X3dResources.html#QualityAssurance

	(new replacement server is configured and nearly improved, when ready the address is)
	https://savage.nps.edu/X3dValidator

So.  That is a lot of generality.  If you still have difficulties with a particular scene, let's focus on that next.

Thanks for these efforts John.

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