[x3d-public] X3D 4.0 specification problem: TextureProjectorparallel.fieldOfView

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sat Dec 28 21:07:30 PST 2024


Thanks for your efforts.  Here are my attempted answers.

=====================================

  1.
"ProtoInstance with USE field should not contain a name field in Holger's Library examples.  Previously discussed, with no change evident."

ProtoInstance with USE (attribute, not a field) pointing to the original DEF ProtoInstance is also required to have a name.

If I recall correctly, for some years it was not required in the XML encoding, but extended inquiry by X3D community and working group eventually made it required.

However in the ClassicVRML Encoding, only the USE identifier is needed.

  *
X3D ClassicVRML Encoding 4.0 (draft), Annex A Grammar
  *
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-2v4.0-WD1/Part02/grammar.html

nodeStatement::=
node |
DEF nodeNameId node |
USE nodeNameId ;

This means that requirements are NOT the same between XML encoding and ClassicVRML encoding:  this is a rare difference between the two.

References of interest:

  *
X3D Tooltips, DTD autogenerated documentation and XML Schema autogenerated documentation do not require it.
  *
https://www.web3d.org/x3d/tooltips/X3dTooltips.html#ProtoInstance
  *
https://www.web3d.org/specifications/X3dDoctypeDocumentation4.0.html#ProtoInstance
  *
https://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_ProtoInstance.html

  *
Mantis 678: 4.3.10 - ProtoInstance always requires name, even when USE node
  *
https://mantis.web3d.org/view.php?id=678 (resolved)
  *
Requires USE node for XML encoding, matching VRML encoding

  *
X3D XML Encoding 4.0 (draft), Concepts, 4.3.10 ProtoInstance and fieldValue statement syntax
  *
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-WD1/Part01/concepts.html#ProtoInstanceAndFieldValueStatement
  *
ProtoInstance definitions always require a valid name, even when defining a USE node. This approach permits confirmation of author intent that the correct prototype is applied.
  *
EXAMPLE 16  ProtoInstance USE node
  *
<ProtoInstance USE='MyVPO' name='ViewPositionOrientation'/>

I am also finding mixed messages in validation and documentation, so further review and reconciliation is needed.

I don't think we considered the difference with Classic VRML encoding when applying this to XML encoding.  If anyone is concerned, we can reopen the issue.

Thanks for identifying a problem area, I'll work to ensure that the validation and documentation tools match the draft 4.0 XML encoding specification.

=====================================

2. "X3dToJson.xslt produces an MFString for NavigationInfo at type, should be array of strings"

MFString is an array of strings.  So apologies but I don't understand.  It is not clear what problem you are identifying.  An example would help.

Here is one...  It looks like a single string is being produced, incorrectly, rather than an MFString array of strings.

  *
X3D Example Archives: X3D4AM, X3D for Advanced Modeling, Hello World Scenes, Hello Portugal
  *
https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloPortugalIndex.html
  *
.x3d XML: <NavigationInfo type='"EXAMINE" "LOOKAT" "ANY"'/>
  *
JSON:

          { "NavigationInfo":
            {
              "@type":"\"EXAMINE\" \"LOOKAT\" \"ANY\""
            }
          },

Please confirm what you think the syntax for "@type" should be, the following instead?  At that point we have shared understanding and I can apply a change to the X3dToJson.xslt stylesheet.

  *

 "@type":["EXAMINE","LOOKAT","ANY"]

Reference:

  *
X3D to JSON Stylesheet Converter
  *
https://www.web3d.org/x3d/stylesheets/X3dToJson.html

=====================================

3. "X3dToJson.xslt: Appearance-pointProperties should be an object, not an array."

The following is what I am finding in our X3D Example Archives.  PointProperties seems correct.

  *
 X3D Example Archives: Basic, Points, Basic Point Sprites
  *
https://www.web3d.org/x3d/content/examples/Basic/Points/BasicPointSpritesIndex.html
  *
https://www.web3d.org/x3d/content/examples/Basic/Points/BasicPointSprites.x3d
  *
https://www.web3d.org/x3d/content/examples/Basic/Points/BasicPointSprites.json

      <Shape>
        <Appearance DEF='PointProperties1'>
          <PointProperties attenuation='1 0.01 0.1' containerField='pointProperties' pointSizeMaxValue='100' pointSizeMinValue='5' pointSizeScaleFactor='100'/>
          <!-- X3Dv3.3 ImageTexture has no effect on points, X3Dv4.0 each point is replaced by an image sprite -->
          <ImageTexture url='"images/sphere.png" "https://www.web3d.org/x3d/content/examples/Basic/Points/images/sphere.png"'/>
        </Appearance>
        <PointSet>
          <Coordinate point='1 0 0 0.970142 0.242536 0 0.970142 0 0.242536 0.904534 0.301511 0.301511 0.83205 0 0.5547 0.666667 0.333333 0.666667 0.5547 0 0.83205 0.301511 0.301511 0.904534 0.242536 0 0.970142 0 0.242536 0.970142 0 0 1 0.83205 0.5547 0 0.666667 0.666667 0.333333 0.333333 0.666667 0.666667 0 0.5547 0.83205 0.5547 0.83205 0 0.301511 0.904534 0.301511 0 0.83205 0.5547 0.242536 0.970142 0 0 0.970142 0.242536 0 1 0 -0.242536 0 0.970142 -0.301511 0.301511 0.904534 -0.5547 0 0.83205 -0.666667 0.333333 0.666667 -0.83205 0 0.5547 -0.904534 0.301511 0.301511 -0.970142 0 0.242536 -0.970142 0.242536 0 -1 0 0 -0.333333 0.666667 0.666667 -0.666667 0.666667 0.333333 -0.83205 0.5547 0 -0.301511 0.904534 0.301511 -0.5547 0.83205 0 -0.242536 0.970142 0 0 -0.242536 0.970142 0.301511 -0.301511 0.904534 0.666667 -0.333333 0.666667 0.904534 -0.301511 0.301511 0.970142 -0.242536 0 0 -0.5547 0.83205 0.333333 -0.666667 0.666667 0.666667 -0.666667 0.333333 0.83205 -0.5547 0 0 -0.83205 0.5547 0.301511 -0.904534 0.301511 0.5547 -0.83205 0 0 -0.970142 0.242536 0.242536 -0.970142 0 0 -1 0 -0.970142 -0.242536 0 -0.904534 -0.301511 0.301511 -0.666667 -0.333333 0.666667 -0.301511 -0.301511 0.904534 -0.83205 -0.5547 0 -0.666667 -0.666667 0.333333 -0.333333 -0.666667 0.666667 -0.5547 -0.83205 0 -0.301511 -0.904534 0.301511 -0.242536 -0.970142 0 0 0 -1 0 0.242536 -0.970142 0.242536 0 -0.970142 0.301511 0.301511 -0.904534 0.5547 0 -0.83205 0.666667 0.333333 -0.666667 0.83205 0 -0.5547 0.904534 0.301511 -0.301511 0.970142 0 -0.242536 0 0.5547 -0.83205 0.333333 0.666667 -0.666667 0.666667 0.666667 -0.333333 0 0.83205 -0.5547 0.301511 0.904534 -0.301511 0 0.970142 -0.242536 -0.970142 0 -0.242536 -0.904534 0.301511 -0.301511 -0.83205 0 -0.5547 -0.666667 0.333333 -0.666667 -0.5547 0 -0.83205 -0.301511 0.301511 -0.904534 -0.242536 0 -0.970142 -0.666667 0.666667 -0.333333 -0.333333 0.666667 -0.666667 -0.301511 0.904534 -0.301511 0.904534 -0.301511 -0.301511 0.666667 -0.333333 -0.666667 0.301511 -0.301511 -0.904534 0 -0.242536 -0.970142 0.666667 -0.666667 -0.333333 0.333333 -0.666667 -0.666667 0 -0.5547 -0.83205 0.301511 -0.904534 -0.301511 0 -0.83205 -0.5547 0 -0.970142 -0.242536 -0.301511 -0.301511 -0.904534 -0.666667 -0.333333 -0.666667 -0.904534 -0.301511 -0.301511 -0.333333 -0.666667 -0.666667 -0.666667 -0.666667 -0.333333 -0.301511 -0.904534 -0.301511'/>
          <Color color='1 0 0 0.970142 0.242536 0 0.970142 0 0.242536 0.904534 0.301511 0.301511 0.83205 0 0.5547 0.666667 0.333333 0.666667 0.5547 0 0.83205 0.301511 0.301511 0.904534 0.242536 0 0.970142 0 0.242536 0.970142 0 0 1 0.83205 0.5547 0 0.666667 0.666667 0.333333 0.333333 0.666667 0.666667 0 0.5547 0.83205 0.5547 0.83205 0 0.301511 0.904534 0.301511 0 0.83205 0.5547 0.242536 0.970142 0 0 0.970142 0.242536 0 1 0 0.242536 0 0.970142 0.301511 0.301511 0.904534 0.5547 0 0.83205 0.666667 0.333333 0.666667 0.83205 0 0.5547 0.904534 0.301511 0.301511 0.970142 0 0.242536 0.970142 0.242536 0 1 0 0 0.333333 0.666667 0.666667 0.666667 0.666667 0.333333 0.83205 0.5547 0 0.301511 0.904534 0.301511 0.5547 0.83205 0 0.242536 0.970142 0 0 0.242536 0.970142 0.301511 0.301511 0.904534 0.666667 0.333333 0.666667 0.904534 0.301511 0.301511 0.970142 0.242536 0 0 0.5547 0.83205 0.333333 0.666667 0.666667 0.666667 0.666667 0.333333 0.83205 0.5547 0 0 0.83205 0.5547 0.301511 0.904534 0.301511 0.5547 0.83205 0 0 0.970142 0.242536 0.242536 0.970142 0 0 1 0 0.970142 0.242536 0 0.904534 0.301511 0.301511 0.666667 0.333333 0.666667 0.301511 0.301511 0.904534 0.83205 0.5547 0 0.666667 0.666667 0.333333 0.333333 0.666667 0.666667 0.5547 0.83205 0 0.301511 0.904534 0.301511 0.242536 0.970142 0 0 0 1 0 0.242536 0.970142 0.242536 0 0.970142 0.301511 0.301511 0.904534 0.5547 0 0.83205 0.666667 0.333333 0.666667 0.83205 0 0.5547 0.904534 0.301511 0.301511 0.970142 0 0.242536 0 0.5547 0.83205 0.333333 0.666667 0.666667 0.666667 0.666667 0.333333 0 0.83205 0.5547 0.301511 0.904534 0.301511 0 0.970142 0.242536 0.970142 0 0.242536 0.904534 0.301511 0.301511 0.83205 0 0.5547 0.666667 0.333333 0.666667 0.5547 0 0.83205 0.301511 0.301511 0.904534 0.242536 0 0.970142 0.666667 0.666667 0.333333 0.333333 0.666667 0.666667 0.301511 0.904534 0.301511 0.904534 0.301511 0.301511 0.666667 0.333333 0.666667 0.301511 0.301511 0.904534 0 0.242536 0.970142 0.666667 0.666667 0.333333 0.333333 0.666667 0.666667 0 0.5547 0.83205 0.301511 0.904534 0.301511 0 0.83205 0.5547 0 0.970142 0.242536 0.301511 0.301511 0.904534 0.666667 0.333333 0.666667 0.904534 0.301511 0.301511 0.333333 0.666667 0.666667 0.666667 0.666667 0.333333 0.301511 0.904534 0.301511'/>
        </PointSet>
      </Shape>
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"PointProperties1",
                          "-pointProperties":[
                            { "PointProperties":
                              {
                                "@attenuation":[1,0.01,0.1],
                                "@pointSizeMaxValue":100,
                                "@pointSizeMinValue":5,
                                "@pointSizeScaleFactor":100
                              }
                            }
                          ],
                          "-children":[
                            {
                              "#comment":"X3Dv3.3 ImageTexture has no effect on points, X3Dv4.0 each point is replaced by an image sprite"
                            }
                          ],
                          "-texture":
                            { "ImageTexture":
                              {
                                "@url":["images/sphere.png","https://www.web3d.org/x3d/content/examples/Basic/Points/images/sphere.png"]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "PointSet":
                        {
                          "-coord":
                            { "Coordinate":
                              {
                                "@point":[1,0,0,0.970142,0.242536,0,0.970142,0,0.242536,0.904534,0.301511,0.301511,0.83205,0,0.5547,0.666667,0.333333,0.666667,0.5547,0,0.83205,0.301511,0.301511,0.904534,0.242536,0,0.970142,0,0.242536,0.970142,0,0,1,0.83205,0.5547,0,0.666667,0.666667,0.333333,0.333333,0.666667,0.666667,0,0.5547,0.83205,0.5547,0.83205,0,0.301511,0.904534,0.301511,0,0.83205,0.5547,0.242536,0.970142,0,0,0.970142,0.242536,0,1,0,-0.242536,0,0.970142,-0.301511,0.301511,0.904534,-0.5547,0,0.83205,-0.666667,0.333333,0.666667,-0.83205,0,0.5547,-0.904534,0.301511,0.301511,-0.970142,0,0.242536,-0.970142,0.242536,0,-1,0,0,-0.333333,0.666667,0.666667,-0.666667,0.666667,0.333333,-0.83205,0.5547,0,-0.301511,0.904534,0.301511,-0.5547,0.83205,0,-0.242536,0.970142,0,0,-0.242536,0.970142,0.301511,-0.301511,0.904534,0.666667,-0.333333,0.666667,0.904534,-0.301511,0.301511,0.970142,-0.242536,0,0,-0.5547,0.83205,0.333333,-0.666667,0.666667,0.666667,-0.666667,0.333333,0.83205,-0.5547,0,0,-0.83205,0.5547,0.301511,-0.904534,0.301511,0.5547,-0.83205,0,0,-0.970142,0.242536,0.242536,-0.970142,0,0,-1,0,-0.970142,-0.242536,0,-0.904534,-0.301511,0.301511,-0.666667,-0.333333,0.666667,-0.301511,-0.301511,0.904534,-0.83205,-0.5547,0,-0.666667,-0.666667,0.333333,-0.333333,-0.666667,0.666667,-0.5547,-0.83205,0,-0.301511,-0.904534,0.301511,-0.242536,-0.970142,0,0,0,-1,0,0.242536,-0.970142,0.242536,0,-0.970142,0.301511,0.301511,-0.904534,0.5547,0,-0.83205,0.666667,0.333333,-0.666667,0.83205,0,-0.5547,0.904534,0.301511,-0.301511,0.970142,0,-0.242536,0,0.5547,-0.83205,0.333333,0.666667,-0.666667,0.666667,0.666667,-0.333333,0,0.83205,-0.5547,0.301511,0.904534,-0.301511,0,0.970142,-0.242536,-0.970142,0,-0.242536,-0.904534,0.301511,-0.301511,-0.83205,0,-0.5547,-0.666667,0.333333,-0.666667,-0.5547,0,-0.83205,-0.301511,0.301511,-0.904534,-0.242536,0,-0.970142,-0.666667,0.666667,-0.333333,-0.333333,0.666667,-0.666667,-0.301511,0.904534,-0.301511,0.904534,-0.301511,-0.301511,0.666667,-0.333333,-0.666667,0.301511,-0.301511,-0.904534,0,-0.242536,-0.970142,0.666667,-0.666667,-0.333333,0.333333,-0.666667,-0.666667,0,-0.5547,-0.83205,0.301511,-0.904534,-0.301511,0,-0.83205,-0.5547,0,-0.970142,-0.242536,-0.301511,-0.301511,-0.904534,-0.666667,-0.333333,-0.666667,-0.904534,-0.301511,-0.301511,-0.333333,-0.666667,-0.666667,-0.666667,-0.666667,-0.333333,-0.301511,-0.904534,-0.301511]
                              }
                            },
                          "-color":
                            { "Color":
                              {
                                "@color":[1,0,0,0.970142,0.242536,0,0.970142,0,0.242536,0.904534,0.301511,0.301511,0.83205,0,0.5547,0.666667,0.333333,0.666667,0.5547,0,0.83205,0.301511,0.301511,0.904534,0.242536,0,0.970142,0,0.242536,0.970142,0,0,1,0.83205,0.5547,0,0.666667,0.666667,0.333333,0.333333,0.666667,0.666667,0,0.5547,0.83205,0.5547,0.83205,0,0.301511,0.904534,0.301511,0,0.83205,0.5547,0.242536,0.970142,0,0,0.970142,0.242536,0,1,0,0.242536,0,0.970142,0.301511,0.301511,0.904534,0.5547,0,0.83205,0.666667,0.333333,0.666667,0.83205,0,0.5547,0.904534,0.301511,0.301511,0.970142,0,0.242536,0.970142,0.242536,0,1,0,0,0.333333,0.666667,0.666667,0.666667,0.666667,0.333333,0.83205,0.5547,0,0.301511,0.904534,0.301511,0.5547,0.83205,0,0.242536,0.970142,0,0,0.242536,0.970142,0.301511,0.301511,0.904534,0.666667,0.333333,0.666667,0.904534,0.301511,0.301511,0.970142,0.242536,0,0,0.5547,0.83205,0.333333,0.666667,0.666667,0.666667,0.666667,0.333333,0.83205,0.5547,0,0,0.83205,0.5547,0.301511,0.904534,0.301511,0.5547,0.83205,0,0,0.970142,0.242536,0.242536,0.970142,0,0,1,0,0.970142,0.242536,0,0.904534,0.301511,0.301511,0.666667,0.333333,0.666667,0.301511,0.301511,0.904534,0.83205,0.5547,0,0.666667,0.666667,0.333333,0.333333,0.666667,0.666667,0.5547,0.83205,0,0.301511,0.904534,0.301511,0.242536,0.970142,0,0,0,1,0,0.242536,0.970142,0.242536,0,0.970142,0.301511,0.301511,0.904534,0.5547,0,0.83205,0.666667,0.333333,0.666667,0.83205,0,0.5547,0.904534,0.301511,0.301511,0.970142,0,0.242536,0,0.5547,0.83205,0.333333,0.666667,0.666667,0.666667,0.666667,0.333333,0,0.83205,0.5547,0.301511,0.904534,0.301511,0,0.970142,0.242536,0.970142,0,0.242536,0.904534,0.301511,0.301511,0.83205,0,0.5547,0.666667,0.333333,0.666667,0.5547,0,0.83205,0.301511,0.301511,0.904534,0.242536,0,0.970142,0.666667,0.666667,0.333333,0.333333,0.666667,0.666667,0.301511,0.904534,0.301511,0.904534,0.301511,0.301511,0.666667,0.333333,0.666667,0.301511,0.301511,0.904534,0,0.242536,0.970142,0.666667,0.666667,0.333333,0.333333,0.666667,0.666667,0,0.5547,0.83205,0.301511,0.904534,0.301511,0,0.83205,0.5547,0,0.970142,0.242536,0.301511,0.301511,0.904534,0.666667,0.333333,0.666667,0.904534,0.301511,0.301511,0.333333,0.666667,0.666667,0.666667,0.666667,0.333333,0.301511,0.904534,0.301511]
                              }
                            }
                        }
                      }
                  }

If you still think that there is a problem, please describe again and provide an example.

=====================================

4. "OrthoViewpoint.setFieldOfView has 4 parameters, probably should be one parameter, or X3DJSAIL should provide a 4 parameter option."

OrthoViewpoint fieldOfView is only zero or four floats.  Anything else does not define the 4 corners of an orthographic field of view.  X3DJSAIL is OK.

This has been the basis of the long-running issue: do we leave it with type MFFloat, or do we make it type SFVec4f (similar to ClipPlane.plane and TextureProjectorParallel.fieldOfView) so that incorrect array lengths are detected during validation.

Related:

  *
X3D Tooltips 4.0, OrthoViewpoint.fieldOfView
  *
https://www.web3d.org/x3d/tooltips/X3dTooltips.html#OrthoViewpoint.fieldOfView
  *
Warning: if provided, OrthoViewpoint fieldOfView has exactly four numeric values, otherwise results are undefined.
  *
Warning: OrthoViewpoint fieldOfView has type MFFloat even though SFVec3f is more correct to prevent modeling errors, deficiency recorded as Mantis 1398

  *
Mantis 1398: OrthoViewpoint fieldOfView type needs to be SFVec4f, not MFFloat
  *
https://mantis.web3d.org/view.php?id=1398

  *
X3D Architecture 4.1 (draft), 42.4.2 TextureProjectorParallel
  *
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/navigation.html#OrthoViewpoint
  *
The fieldOfView field for this parallel projection specifies minimum and maximum extents of the view in units of the local coordinate system. A small field of view roughly corresponds to a telephoto lens; a large field of view roughly corresponds to a wide-angle lens. If provided, the fieldOfView field has exactly four numeric values, otherwise results are undefined.
  *
X3DJSAIL OrthoViewpoint setFieldOfView has multiple methods for floats, doubles (which are downcast to floats) and integers (which are promoted to floats).  The preceding warning will appear in the Javadoc following the next release build.
  *
https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Navigation/OrthoViewpoint.html#setFieldOfView(float[])

I hope that this answer is satisfactory.

=====================================

As ever:

  1.
Bug reports are effective when example snippets are provided.  Showing errors or problems in any .x3d .x3dv .json .java .py .ttl examples or other X3D source is the best way to identify them.
  2.
Bug reports are even more effective when example errors can be identified in the X3D Example Archives.
  3.
Inability to find a node or field of interest in the X3D Example Archives often indicates that we need another example so that checking and conversions can be part of our comprehensive error checking.
  4.
No diffs on XSLT conversions or autogenerated code will be accepted.  These are complex codebases and we can't afford to have potential errors inadvertently committed.  Getting clear on correct inputs producing correct outputs is sufficient.

=====================================

Again thanks, have fun with rigorous X3D!  🙂


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



________________________________
From: John Carlson <yottzumm at gmail.com>
Sent: Wednesday, December 18, 2024 10:10 PM
To: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org>
Cc: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; khyoo at chungbuk.ac.kr <khyoo at chungbuk.ac.kr>; Myeong Won Lee <myeongwonlee at gmail.com>
Subject: Re: [x3d-public] X3D 4.0 specification problem: TextureProjectorparallel.fieldOfView

Summary, pending updates from Don.

ProtoInstance with USE field should not contain a name field in Holger's Library examples.  Previously discussed, with no change evident.
X3dToJson.xslt produces an MFString for NavigationInfo at type, should be array of strings, per Don's suggestion.  I will try to reapply a patch.
X3dToJson.xslt: Appearance-pointProperties should be an object, not an array.
X3DToJava.xslt OrthoViewpoint.setFieldOfView has 4 parameters, probably should be one parameter, or X3DJSAIL should provide a 4 parameter option.
John needs to fix VolumeEmitter.java.
There seems to be some package conflict with X3DJSAIL and Holger's VolumeEmitter example.  I am not sure.

I will repeat the JSON tests with Holger's x3d-tidy.

Details:


I changed the X3DUOM+X_ITE field type of OrthoViewpoint.fieldOfView temporarily, and ran my  fieldTypesGenerator.py in X3DJSONLD:  My fieldTypes.js had this change in git diff:

        "centerOfRotation" : "SFVec3f",
        "description" : "SFString",
        "farDistance" : "SFFloat",
-       "fieldOfView" : "MFFloat",
+       "fieldOfView" : "SFVec3f",
        "IS" : "SFNode",
        "isBound" : "SFBool",
        "jump" : "SFBool",


Plus others from Holger's X_ITE component.  I have not tried any serialization of X3D JSON versions of glTF samples yet.

Then I ran ```bash local.sh``` in  X3DJSONLD/src/main/shell

json2all.js produced no changes to my serialized files.  There were only changes to date in my JSON files.  I elide the date when producing serialized files, otherwise, I would get loads of change that I would have to check in with no real modifications to the file.  What this means is the serialized files reflect the source XML, not the intermediate JSON.

I went looking for more examples.  Since I couldn't find any in the email (is there one?) I pursued the sourceforge archives.

The only one I found in the sourceforge archives was this:

Basic/development/TestSchematronDiagnostics.x3d:

<OrthoViewpoint DEF='NoSpacesInDescription' description='NeedToPutSpacesInDescription'/>

No ConformanceNist?  Frustrated, I decided to do a svn update.  There were many updates.

No OrthoViewpoint search result updates.  I'm not sure what to use for fieldOfView to test my serializers?

I will do a search on Holger's Library:

Found two;, great!
./Tests/Components/ParticleSystems/VolumeEmitter.x3d
./Tests/Components/Shape/Connectors.x3d

Moved those to my data folder.

Try to run several.sh

Apparently, the X3DJSONLD install had failed.  Reinstalled.

Reran.

Ran into issues with iri and iri-reference in X3D JSON schema.  I had not upgraded X3DJSONLD.

Fixed ajv configuration.


Ajv reports:

Adding schema:  4.0
Suppressing @USE missing property.  Use $ node x3dvalidate.js --fullreport ../data/Connectors.json ... to reveal possibly confusing errors
Suppressing NavigationInfo.type as array.  Use $ node x3dvalidate.js --fullreport ../data/Connectors.json file ... to reveal possibly confusing errors
Suppressing null passingSchemas.  Use $ node x3dvalidate.js --fullreport ../data/Connectors.json file ... to reveal possibly confusing errors
Success validating ../data/Connectors.json
chopped rejoined "\"PLANE_create3000.de\", \"ANY\""
Suppressing @USE missing property.  Use $ node x3dvalidate.js --fullreport ../data/VolumeEmitter.json ... to reveal possibly confusing errors
Suppressing null passingSchemas.  Use $ node x3dvalidate.js --fullreport ../data/VolumeEmitter.json file ... to reveal possibly confusing errors
Success validating ../data/VolumeEmitter.json

```$ npx x3dvalidate --fullreport ../data/Connectors.json``` reports:

keyword: type
 location in document: /X3D/Scene/-children/4/NavigationInfo/@type
 message: must be array
 params: {"type":"array"}
 file: ../data/Connectors.json
 version: 4.0

The JSON code looks like:

          { "NavigationInfo":
            {
              "@type":"\"PLANE_create3000.de\", \"ANY\""
            }
          },

@type should be an array, as Don says, but he doesn't change the stylesheet.  I guess I will look for stylesheet updates.  I don't see anything relevant, updating anyway.
  I will propose a patch again.

I guess I'm still arguing with Don about this.

```$ npx x3dvalidate --fullreport ../data/VolumeEmitter.json``` reports:

keyword: type
 location in document: /X3D/Scene/-children/4/ParticleSystem/-appearance/Appearance/-pointProperties
 message: must be object
 params: {"type":"object"}
 file: ../data/VolumeEmitter.json
 version: 4.0

This one is more interesting and indicates a problem with X3dToJson.xslt or X3D JSON schema.

Relevant code:

              "-appearance":
                { "Appearance":
                  {
                    "-pointProperties":[
                      { "PointProperties":
                        {
                          "@pointSizeScaleFactor":2,
                          "@pointSizeMaxValue":2
                        }
                      }
                    ]
                  }
                }

XML looks like:

      <Appearance>
        <PointProperties
            pointSizeScaleFactor='2'
            pointSizeMaxValue='2'/>
      </Appearance>

Web3d is down, so I can't reference the standard.  X_ITE's website indicates Appearance.pointProperties is an SFNode:

SFNode [in, out] pointProperties NULL
[PointProperties]

Single contained PointProperties<https://create3000.github.io/x_ite/components/shape/pointproperties/> node that can specify additional visual attributes applied to corresponding point geometry.


X3DOM's website says:


pointProperties
SFNode
PointProperties<https://doc.x3dom.org/developer/x3dom/nodeTypes/PointProperties.html>
[https://doc.x3dom.org/static/images/x3d.png]
The pointProperties field, if specified, shall contain a PointProperties node. If pointProperties is NULL or unspecified, the pointProperties field has no effect.
So it appears like pointProperties should be an object,and not an array.  I am currently using X3dToJson.xslt, which is incorrect from the point of view of X3DOM and X_ITE, and X3D JSON schema is correct.  This is a new fiinding for me, and I will try to patch the stylesheet.

My suggestion is to review X3dToJson.xslt and have a correct X3D JSON schema to test the results.

Continuing with several.sh:

My java is can mostly compile, see compilation:

javac -proc:full -J-Xss1g -J-Xmx4g Connectors.java
~/X3DJSONLD/src/main/shell
~/X3DJSONLD/src/main/java/net/coderextreme/data ~/X3DJSONLD/src/main/shell
javac -proc:full -J-Xss1g -J-Xmx4g VolumeEmitter.java
VolumeEmitter.java:85: error: cannot find symbol
          .setEmitter(new VolumeEmitter().setDirection(new double[] {0,0,0}).setMass(0.01).setSurfaceArea(0.01)
                                         ^
  symbol:   method setDirection(double[])
  location: class VolumeEmitter
1 error

There's issues with Don's, probably pending X3dToJava.xslt.  Will attempt to update stylesheet:



compiling
~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
.\net\x3djsonld\data\VolumeEmitter.java:110: error: no suitable method found for setFieldOfView(double,double,double,double)
    .addChild(new OrthoViewpoint().setDescription("OrthoViewpoint").setFieldOfView(-1.5,-1.5,1.5,1.5))
                                                                   ^
    method OrthoViewpoint.setFieldOfView(float[]) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(MFFloat) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(ArrayList<Float>) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(int[]) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(double[]) is not applicable
      (actual and formal argument lists differ in length)
.\net\x3djsonld\data\VolumeEmitter.java:113: error: cannot find symbol
      .setEmitter(new /*avoid name collision with file name by defining full package*/org.web3d.x3d.jsail.VolumeEmitter().setDirection(0.0,0.0,0.0).setMass(0.01).setSurfaceArea(0.01)
                                                                                                         ^
  symbol:   class VolumeEmitter
  location: package org.web3d.x3d.jsail
2 errors

More work with Java stylesheet.  Holger needs to update his ProtoInstances:

BEGIN ../data/Connectors.x3d > java, *** Error: found ProtoInstance USE='N1' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N1' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N1' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N2' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N3' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N6' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N4' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N5' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N7' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N6' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N7' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N8' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N1' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N2' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N3' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N4' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N5' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N6' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N7' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
*** Error: found ProtoInstance USE='N8' with unnecessary name='Node' included, need to remove name field from ProtoInstance USE nodes
END ../data/Connectors.x3d

I'm guessing even though X3dToJava.xslt stylesheet is updated, X3DJSAIL still needs to be updated:  (these are fresh downloads from sourceforge, with my own build of X3DJSAIL, which are probably not released):

Same errors as above:

.\net\x3djsonld\data\VolumeEmitter.java:110: error: no suitable method found for setFieldOfView(double,double,double,double)
    .addChild(new OrthoViewpoint().setDescription("OrthoViewpoint").setFieldOfView(-1.5,-1.5,1.5,1.5))
                                                                   ^
    method OrthoViewpoint.setFieldOfView(float[]) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(MFFloat) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(ArrayList<Float>) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(int[]) is not applicable
      (actual and formal argument lists differ in length)
    method OrthoViewpoint.setFieldOfView(double[]) is not applicable
      (actual and formal argument lists differ in length)
.\net\x3djsonld\data\VolumeEmitter.java:113: error: cannot find symbol
      .setEmitter(new /*avoid name collision with file name by defining full package*/org.web3d.x3d.jsail.VolumeEmitter().setDirection(0.0,0.0,0.0).setMass(0.01).setSurfaceArea(0.01)
                                                                                                         ^
  symbol:   class VolumeEmitter
  location: package org.web3d.x3d.jsail

More stuff on Holger's side with stylesheet conversion.  with X3dToES5.xslt.  I will look for stylesheet updates.  The stylesheet up to date, but still errors:

$ ../../../../shell/jjs.sh Connectors.js 2>&1 |grep Exception|sort -u
org.web3d.x3d.sai.InvalidProtoException: *** ProtoInstance has name field, which is not included in a ProtoInstance USE node.

It does look like Don has done a great deal of work on the stylesheets overall, further investigation and updates are needed on my part.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20241229/81159ae0/attachment-0001.html>


More information about the x3d-public mailing list