[x3d-public] Basic examples. -geometry field should be array(MFNode) for RigidBody and according to X3DUOM

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sun Jan 6 07:40:04 PST 2019


On 1/6/2019 1:05 AM, John Carlson wrote:
> Fix X3D JSON hand generated schema to make the following errors.  I would tend towards going to the autogenerated schema, but it needs review, perhaps. This is part of the review of the schema.

Yes, the manually produced X3D JSON Schema needs improvement.  If we can figure out how to fix the occasional JSON errors that occur when it validates, that would be great progress.

When JSON Schema itself goes from draft-97 to draft-08, that will be a good time to improve/test further to match and then apply our design patterns to X3D JSON Schema autogeneration.

> Note these are under development,
> 
> BallBounce.json:            "@name":"warning",
> 
> BallBounceSimple.json:            "@name":"warning",
> 
> BallJoint.json:            "@name":"warning",
> 
> BodyGeometry.json:            "@name":"warning",
> 
> BounceTrimesh.json:            "@name":"warning",
> 
> CarDemoMain.json:            "@name":"warning",
> 
> CarDemoMain.json:            "@name":"warning",
> 
> CarDemoWorldModel.json:            "@name":"warning",
> 
> DoubleHingeJoint.json:            "@name":"warning",
> 
> MotorJoint.json:            "@name":"warning",
> 
> MovingBody.json:            "@name":"warning",
> 
> SingleHingeJoint.json:            "@name":"warning",
> 
> SliderJoint.json:            "@name":"warning",
> 
> UniversalJoint.json:            "@name":"warning",

I recommend that when you print out @name=warning and @name=error meta elements such as these, also be sure to print out the @content message.  Some of these say that the above scenes have known errors in them.  Incremental improvement, also let's you know that your tool is not failing if the scene has incorrect content.

> This error has been reported many times with out any action.

Correct.  Not sure we have any good implementations of RigidBodyPhysics component?  That would help in testing and improvement.  (Xj3D is at least 90% complete but requires further debugging.)  That has been the story for these scenes for a long time.

Anyone interested in verifying correct implementations and examples exist for RigidBodyPhysics component?

I believe the rigid body nodes and architecture are sound, but this component is one of the parts of X3D v3.2 that continues to suffer following insufficient follow-through by the groups working on them.

This is also why, in addition to multiple implementations, the X3D Working Group asks for a full set of test example scenes before approving a new component.  Hopefully this will ensure that new components in X3Dv4 avoid similar doldrums.

> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BallBounce.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BallBounceSimple.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BallJoint.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BodyGeometry.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BounceTrimesh.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/DoubleHingeJoint.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/MotorJoint.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/MovingBody.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/SingleHingeJoint.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/SliderJoint.json
> 
> 0 Ajv 3.2 Validation failed on C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/UniversalJoint.json

Good to see that you have AJV working, hoping we can review that part of the test harness together next week.

Hopefully the following analysis helped your important design and implementation work for X3D Python.

> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *Brutzman, Donald (Don) (CIV) <mailto:brutzman at nps.edu>
> *Sent: *Saturday, January 5, 2019 8:55 PM
> *To: *John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *Re: [x3d-public] Basic examples. -geometry field should be array(MFNode) for RigidBody and according to X3DUOM
> 
> On 1/4/2019 9:04 PM, John Carlson wrote:
> 
> [...]
> 
>  > When should -geometry be an SFNode and when should it be an MFNode (array in JSON Schema)?
> 
>  >
> 
>  > Geometry is still an MFNode for NurbsSet and RigidBody in X3DUOM.
> 
> X3D Architecture Specification ISO 19775-1 governs all typing.
> 
> Strict typing in X3D is of course our best friend, it prevents Garbage In Garbage Out (GIGO) in scene content so that players and loaders can do the right thing exceedingly well.
> 
> To facilitate checking on important questions like this, the X3D Tooltips include convenience links to various references relating to each node.  Let's explore.
> 
> ===================================
> 
> Shape geometry field is SFNode:
> 
> X3D Tooltips: Shape
> 
>                  http://www.web3d.org/x3d/tooltips/X3dTooltips.html#Shape.geometry
> 
>                  [geometry accessType inputOutput, type SFNode, NULL node] [X3DGeometryNode]
> 
> X3D Architecture, 12.4.5 Shape
> 
>                  http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shape.html#Shape
> 
>                  SFNode  [in,out] geometry   NULL     [X3DGeometryNode]
> 
> X3D Architecture, 11.3.5 X3DGeometryNode
> 
>                  http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#X3DGeometryNode
> 
> Thus Shape geometry only accepts a single node which must in turn implement X3DGeometryNode interface - there are a lot of those.
> 
> ===================================
> 
> RigidBody geometry field is MFNode:
> 
> X3D Tooltips: RigidBody
> 
>                  http://www.web3d.org/x3d/tooltips/X3dTooltips.html#RigidBody
> 
>                  TODO missing entry for geometry field
> 
> X3D Architecture, 37.4.10 RigidBody
> 
>                  http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rigid_physics.html#RigidBody
> 
>                  MFNode     [in,out] geometry             []      [X3DNBodyCollidableNode]
> 
> X3D Architecture, 37.3.1 X3DNBodyCollidableNode
> 
>                  http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rigid_physics.html#X3DNBodyCollidableNode
> 
> Thus RigidBody geometry only accepts an array of nodes implementing X3DNBodyCollidableNode interface.  The only two such nodes are CollidableOffset and CollidableShape.
> 
> =====================================
> 
> Similar patterns for 27.4.9 NurbsSet:
> 
>                  http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/nurbs.html#NurbsSet
> 
>     MFNode  [in]     addGeometry                [X3DNurbsSurfaceGeometryNode]
> 
>     MFNode  [in]     removeGeometry             [X3DNurbsSurfaceGeometryNode]
> 
>     MFNode  [in,out] geometry          []       [X3DNurbsSurfaceGeometryNode]
> 
> etc.
> 
> ===================================
> 
> And so, as you well know, (...wait for it...) this is why we have X3D Unified Object Model (X3DUOM) to help define these specification requirements.  Excerpt documenting the RigidBody case follows, see definition for "geometry" field matching the above references.
> 
>                  X3D Unified Object Model (X3DUOM)
> 
>                  http://www.web3d.org/specifications/X3DUOM.html
> 
>                  http://www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml
> 
> <ConcreteNode name="RigidBody">
> 
>      <InterfaceDefinition specificationUrl="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rigid_physics.html#RigidBody">
> 
>         <componentInfo name="RigidBodyPhysics" level="2"/>
> 
>         <Inheritance baseType="X3DNode"/>
> 
>         <field type="SFFloat"
> 
>                accessType="inputOutput"
> 
>                name="angularDampingFactor"
> 
>                default="0.001"/>
> 
>         <field type="SFVec3f"
> 
>               accessType="inputOutput"
> 
>                name="angularVelocity"
> 
>                default="0 0 0"/>
> 
>         <field type="SFBool"
> 
>                accessType="inputOutput"
> 
>                name="autoDamp"
> 
>                default="false"/>
> 
>         <field type="SFBool"
> 
>                accessType="inputOutput"
> 
>                name="autoDisable"
> 
>                default="false"/>
> 
>         <field type="SFVec3f"
> 
>                accessType="inputOutput"
> 
>                name="centerOfMass"
> 
>                default="0 0 0"/>
> 
>         <field type="SFFloat"
> 
>                accessType="inputOutput"
> 
>                name="disableAngularSpeed"
> 
>                default="0"/>
> 
>         <field type="SFFloat"
> 
>                accessType="inputOutput"
> 
>                name="disableLinearSpeed"
> 
>                default="0"/>
> 
>         <field type="SFTime"
> 
>                accessType="inputOutput"
> 
>                name="disableTime"
> 
>                default="0"
> 
>                minInclusive="0"/>
> 
>         <field type="SFBool"
> 
>                accessType="inputOutput"
> 
>                name="enabled"
> 
>                default="true"/>
> 
>         <field type="SFVec3f"
> 
>                accessType="inputOutput"
> 
>                name="finiteRotationAxis"
> 
>                default="0 1 0"/>
> 
>         <field type="SFBool"
> 
>                accessType="inputOutput"
> 
>                name="fixed"
> 
>                default="false"/>
> 
>         <field type="MFVec3f" accessType="inputOutput" name="forces"/>
> 
>         <field type="MFNode"
> 
>                accessType="inputOutput"
> 
>                name="geometry"
> 
>                acceptableNodeTypes="X3DNBodyCollidableNode"/>
> 
>         <field type="SFMatrix3f"
> 
>                accessType="inputOutput"
> 
>                name="inertia"
> 
>                default="1 0 0 0 1 0 0 0 1"/>
> 
>         <field type="SFFloat"
> 
>                accessType="inputOutput"
> 
>                name="linearDampingFactor"
> 
>                default="0.001"/>
> 
>         <field type="SFVec3f"
> 
>                accessType="inputOutput"
> 
>                name="linearVelocity"
> 
>                default="0 0 0"/>
> 
>         <field type="SFFloat" accessType="inputOutput" name="mass" default="1"/>
> 
>         <field type="SFNode"
> 
>                accessType="inputOutput"
> 
>                name="massDensityModel"
> 
>                default="NULL"
> 
>                acceptableNodeTypes="Sphere|Box|Cone"/>
> 
>         <field type="SFNode"
> 
>                accessType="inputOutput"
> 
>                name="metadata"
> 
>                default="NULL"
> 
>                acceptableNodeTypes="X3DMetadataObject"
> 
>                inheritedFrom="X3DNode"/>
> 
>         <field type="SFRotation"
> 
>                accessType="inputOutput"
> 
>                name="orientation"
> 
>                default="0 0 1 0"/>
> 
>         <field type="SFVec3f"
> 
>                accessType="inputOutput"
> 
>                name="position"
> 
>                default="0 0 0"/>
> 
>         <field type="MFVec3f" accessType="inputOutput" name="torques"/>
> 
>         <field type="SFBool"
> 
>                accessType="inputOutput"
> 
>                name="useFiniteRotation"
> 
>                default="false"/>
> 
>         <field type="SFBool"
> 
>                accessType="inputOutput"
> 
>                name="useGlobalGravity"
> 
>                default="true"/>
> 
>         <field type="SFString"
> 
>                accessType="inputOutput"
> 
>                name="DEF"
> 
>                inheritedFrom="DEF_USE"/>
> 
>         <field type="SFString"
> 
>                accessType="inputOutput"
> 
>                name="USE"
> 
>                inheritedFrom="DEF_USE"/>
> 
>         <field type="SFString"
> 
>                accessType="inputOutput"
> 
>                name="class"
> 
>                inheritedFrom="globalAttributes"/>
> 
>         <containerField default="bodies" type="">
> 
>            <enumeration value="body1" appinfo=""/>
> 
>            <enumeration value="body2" appinfo=""/>
> 
>            <enumeration value="bodies" appinfo=""/>
> 
>         </containerField>
> 
>         <ContentModel>
> 
>            <GroupContentModel name="ChildContentModelCore" minOccurs="0"/>
> 
>            <GroupContentModel name="RigidBodyContentModel" minOccurs="0"/>
> 
>         </ContentModel>
> 
>      </InterfaceDefinition>
> 
> </ConcreteNode>
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