[x3d-public] [x3dom-developers] second round of X3D JSON conversion support using X3dToJson.xslt

Don Brutzman brutzman at nps.edu
Thu Mar 12 08:22:17 PDT 2015


Updates:

1. Build regression tests for X3D Examples Archives now include jslint tests for all .js scripts and .json experimental conversions.

Example output attached.

2.  Online X3D JSON examples completely updated for 2 of our archives.  This gives us lots of regression tests and examples to look at.

	http://x3dgraphics.com/examples/X3dForAdvancedModeling

	http://x3dgraphics.com/examples/X3dForWebAuthors

3.Latest X3dToJson.xslt conversion uses the following syntax for field/fieldValue:

http://x3dgraphics.com/examples/X3dForAdvancedModeling/Animation/CubeWithLabeledSidesViewpointSequencer.json

[...]
         { "Inline":
           {
             "@url":["../GeometricShapes/CubeWithLabeledSides.x3d", "http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/CubeWithLabeledSides.x3d", "../GeometricShapes/CubeWithLabeledSides.wrl", "http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/CubeWithLabeledSides.wrl"],
             "@load":true,
             "@bboxCenter":[0, 0, 0],
             "@bboxSize":[-1, -1, -1]
           }
         },
         { "#comment":"====================" },
         { "ExternProtoDeclare":
           {
             "@appinfo":"Sequentially binds each Viewpoint in a set of Viewpoint USE nodes, creating an automatic tour for a scene",
             "@name":"ViewpointSequencer",
             "@url":["../../Savage/Tools/Animation/ViewpointSequencerPrototype.x3d#ViewpointSequencer", "https://savage.nps.edu/Savage/Tools/Animation/ViewpointSequencerPrototype.x3d#ViewpointSequencer", "../../Savage/Tools/Animation/ViewpointSequencerPrototype.wrl#ViewpointSequencer", "https://savage.nps.edu/Savage/Tools/Animation/ViewpointSequencerPrototype.wrl#ViewpointSequencer"],
             "-field":[
               { "field":
                 {
                   "@accessType":"initializeOnly",
                   "@appinfo":"Viewpoint USE nodes that are sequentially bound",
                   "@name":"viewpoints",
                   "@type":"MFNode"
                 }
               },
               { "field":
                 {
                   "@accessType":"inputOutput",
                   "@appinfo":"number of seconds between viewpoint shifts",
                   "@name":"interval",
                   "@type":"SFTime"
                 }
               },
[...]

4. I think this might be improved to match VRML/ClassicVRML structure more closely, will keep working on it.

On 3/11/2015 10:01 AM, Don Brutzman wrote:
> We had a really great hour-long discussion on the X3D call today.  Thank you Cecile, John, Roy, Leonard, Dick, Anita and Nicholas for participating.
>
> I heard a number of really interesting points:
>
> a. Priorities include round trip support and programmer usefulness
> b.comments support remains possible but needs work, despite omission in JSON spec.
> c. following VRML97/ClassicVRML encoding patterns can really help
> d. handling child nodes has three choices:  always an JSON array, JSON array or JSON object depending on what is present, or "deep knowledge" of X3D node types (e.g. containerField field names)
> e. handling of USE field

On 3/11/2015 11:40 AM, John Carlson wrote:
> Specifically, avoiding including default attribute values when USE is present, but including default values when USE is not present.  There may be some discussion when DEF is on a node which is unlike the node that the USE is on…which default values to to include in USE.

> f. excluding or including default attribute values - both may have merit
> g. can someone compare with Collada JSON and glTF approaches?
> h. D3.js integration is an excellent test case
> i. Javascript function to write X3D JSON back out to .x3d is useful, also enables round-trip testing
> j. Script/field and Prototype/field representations are interesting, perhaps not of everyday interest but might become really useful for X3DOM
> k. Others please?
>
> Meanwhile last night saw a few more improvements in the X3dToJson.xslt stylesheet:
> - integration of jsonlint into build suite regression tests, providing comprehensive error checking of JSON X3D for thousands of example scenes
> - alternative handling of field, fieldValue similar to contained nodes in X3D, improved but still testing
>
> Further improvements to follow based on the above.  I an really encouraged and think that a simple useful JSON X3D is possible, but only through continued group collaboration and compare/contrast/implement/evaluate.
>
> We will include x3dom list on major summary points, and issues that can be of direct benefit, but will conduct most design discussions on x3d-public list.

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