[x3d-public] X3D JSON encoding: .x3d to .json stylesheet, examples available for continued work

Don Brutzman brutzman at nps.edu
Mon Oct 26 23:07:42 PDT 2015


Hi John, thanks for your patience on the X3D JSON topic.  Can be a scary subject, and a long walk in the dark.

(using a halloween voice)  "i'm baacck..."   :0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I. Am happy to announce that a rewritten X3dToJson.xslt stylesheet is now available that can successfully read .x3d (XML) scenes and produce corresponding .json output.

http://www.web3d.org/x3d/stylesheets/X3dToJson.xslt
and
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJson.xslt

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

II.  I've tried to include as many of the design features as possible.  It will be good to review these together when time permits, this is probably worth scheduling a special teleconference.  Original pages, not yet updated:

http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding

Specification relationships diagram showing where this will fit among the X3D Specifications:

http://www.web3d.org/specifications/X3dSpecificationRelationships.png

We've had quite a few design discussions on the mailing lists over the past year.  In practice, I found that creating a stylesheet which consistently work was pretty arduous - jslint is super strict.  But we now have a worthy production tool chain emerging.

It will be great to get feedback on how this current developmental encoding aligns with your work and the earlier loader in X3DOM.  No doubt there are some differences - all blame is mine - deviation was not particularly intentional.  I found that I had to experiment quite a bit to find a design pattern that could handle _all_ X3D constructs including protos, IS/connect etc.  So that pattern is what it currently is.

A particular challenge is that "rootless" nodes at the top of a scene, or similarly at the top of a ProtoBody declaration, seemed to need different handling in comparison to when they appeared at different places inside a scene graph.  Certainly this is the case for comments (which are not natively provided by JSON) and ROUTE and other non-node statements/constructs.

I have tried to make the pattern as concise and consistent as possible.  All further simplification that enables round-tripping (for a future X3D JSON encoding specification) will be great, since that will facilitate use by Javascript programmers and tool builders.

Some open design questions:
a. how to handle embedded Script source code?
b. whether it is OK to group together child MFNode content in a single array using the same container field name - probably worthwhile - though that  might come at the expense of losing the original scene ordering of nodes.
c. what does example javascript code look like for programmers using the encoding?  that will help us choose if multiple variants appear to be feasible.

Other questions I have for you:
d. how does your loader work?
e. once encodings are aligned, can we embed that in the tool suite to facilitate round-trip testing.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

III.I have applied this stylesheet to the entire X3D Examples archive (currently 3864 total X3D scenes).  The great majority of scenes convert successfully and pass jslint testing.  This is automated in the archive production build scripts.  So that gives several thousand examples online to inspect.
http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples

I've also released a new release of X3D-Edit with this update included to facilitate testing on individual scenes.
Found on menu X3D > Export from X3D > JSON encoding
https://savage.nps.edu/X3D-Edit

The stylesheet itself has a few parameter switches to only show scene-graph content, strip comments, and add tracing.  The tracing is helpful to verify that the document tree is being walked properly.

Here are console excerpts and a few examples - DEF/USE names appear when present.  The .json files are attached since the encoding may change over time, so they will leave us with some prior examples archived.  (The scene-graph trace is readable in landscape mode.)

=======================================================================================
build.xml
     <!-- X3dForAdvancedModeling test scenes for JSON encoding development: -->
     <target name="test.X3dToJson" description="test task">
         <property name="traceEnabled"  value="true"/>
         <property name="stripComments" value="false"/>
         <delete verbose="true" file="GeometricShapes/Dodecahedron.json"/>
         <delete verbose="true" file="Inspiration/ObliqueStrategies.json"/>
         <antcall target="processScenes.X3dToJson"/>
     </target>
=======================================================================================
C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/GeometricShapes//Dodecahedron.x3d processing with X3dToJson stylesheet
  X3D
      head
          meta title
          meta description
          meta created
          meta modified
          meta creator
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta identifier
          meta generator
          meta generator
          meta license
      Scene
          Background
          Viewpoint
          Shape Dodecahedron
                  IndexedFaceSet
                          Coordinate
                  Appearance
                          Material
C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/GeometricShapes//Dodecahedron.json processing with jslint

(no output means it passed without any disparaging croaking sounds, no jslint relaxation switches are set.)

=======================================================================================
C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.x3d processing with X3dToJson stylesheet
  X3D
      head
          meta title
          meta description
          meta creator
          meta created
          meta modified
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta reference
          meta subject
          meta Image
          meta audio
          meta audio
          meta audio
          meta TODO
          meta reference
          meta reference
          meta warning
          meta warning
          meta identifier
          meta generator
          meta license
      Scene
          NavigationInfo
          Background
          Transform
                  TouchSensor RandomTextClickedSensor
                  Shape
                          Text
                                  FontStyle MessageFont
                          Appearance
                                  Material
                  Transform
                          Shape HeadlineClickSurface
                                  IndexedFaceSet
                                          Coordinate
                                  Appearance
                                          Material
          Script TextScript
                  #comment initialize() method includes unit test to printAllStrategies() to console
                  #comment TODO insert field definitions here (index string_changed previous next random) and then animate!
                  field index
                  field string_changed
                  field textToSpeechUrl
                  field newCardTime
                  field selectPreviousCard
                  field selectNextCard
                  field selectRandomCard
                  field traceEnabled
          Transform CardTransform
                  Shape
                          Text CardText
                                  FontStyle
                          Appearance
                                  Material
                  ROUTE
                  Sound CardSoundSpatialization
                          #comment Make sure the sound source AudioClip is audible at the user location
                          #comment Not all X3D players seem to use the .mp3
                          #comment &#38; is ampersand character, avoids escaping problems and inconsistencies in browsers and X3D players
                          #comment %20 is space character used in uri/url encoding
                          AudioClip TextToSpeechAudioClip
                  ROUTE
                  ROUTE
          Transform
                  TouchSensor PreviousTextClickedSensor
                  ROUTE
                  Shape
                          Text
                                  FontStyle MessageFont
                          Appearance InterfaceAppearance
                                  Material
                  Transform
                          Shape TransparentClickSurface
                                  #comment support Selectable Text with a scalable IFS
                                  IndexedFaceSet
                                          Coordinate
                                  Appearance
                                          Material
          Transform
                  TouchSensor NextTextClickedSensor
                  ROUTE
                  Shape
                          Text
                                  FontStyle MessageFont
                          Appearance InterfaceAppearance
                  Transform
                          Shape TransparentClickSurface
          Transform
                  TouchSensor RandomTextClickedSensor
                  ROUTE
                  Shape
                          Text
                                  FontStyle MessageFont
                          Appearance InterfaceAppearance
                  Transform
                          Shape TransparentClickSurface
          Transform
                  Anchor TextToSpeechAnchor
                          ROUTE
                          Shape
                                  Text
                                          FontStyle MessageFont
                                  Appearance InterfaceAppearance
                          Transform
                                  Shape TransparentClickSurface
C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json processing with jslint
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:212:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:267:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:346:19:Duplicate '#comment'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:479:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:494:27:Duplicate '#comment'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:495:27:Duplicate '#comment'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:496:27:Duplicate '#comment'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:516:19:Duplicate 'ROUTE'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:523:19:Duplicate 'ROUTE'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:562:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:610:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:709:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:744:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:796:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:831:19:Duplicate '-children'.
jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Inspiration//ObliqueStrategies.json:920:27:Duplicate '-children'.
Java Result: 1
processScenes.X3dToJson complete.
=======================================================================================

Since these outputs are verbose, the tracing is off by default.  Very helpful for debugging tricky cases, of course.


IV.  Here are documentation comments from the top of the stylesheet FYI.  Still reviewing them following all this refactoring work, several likely need updating.  Will be moving many of them to a web page when we are ready to align encoding alternatives further.

<!--
> =======================================================================
> X3D JSON Design Considerations and X3dToJson.xslt Converter Status
>
> References and resources:
> http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding
>
> Status: work in progress.
>
> 1. Working features in this converter:
> - XML elements (X3D nodes), XML attributes (X3D simple-type fields), comments.
> - Square and squiggly brackets, commas.
> - Escaping quotation marks.
> - Handling of singleton numeric values.
> - Handling of MFVec arrays (simple-array form).
> http://www.web3d.org/x3d-resources/content/examples/X3dResources.html#Examples
> - Embedded support in X3D-Edit found under X3D Conversions menu list.
> - Refactor handling of head, component, meta, unit and Scene elements.
> - Confirm proper handling and escaping of MFString array quoted values.
>
> 2. TODO and regression testing:
> - Conversion applied and results available in X3D Examples Archives.
> - Option for suppression of default attribute values inserted by XML parser reading DOCTYPE
> http://stackoverflow.com/questions/11749319/how-can-i-ignore-the-doctype-declaration-with-xsl
> Saxon command-line option expand:off applied (but apparently doesn't always work)
> http://saxonica.com/documentation9.0/using-xsl/commandline.html
> - Strictly differentiate typing of string/number/boolean values and arrays.
> Currently accomplished heuristically, perhaps that is sufficient. Typing can
> allow Javascript type promotion/demotion as needed and make parsing simpler.
> - Handling special characters (UTF-16, Unicode) in strings.
> - Preserve contained CDATA text (principal example: contained Script source code).
> - Round-trip testing using a Javascript program for JSON-to-XML conversion,
> in order to ensure completeness and correctness of round-trip data preservation.
> Probably need to write this since XML-JSON encodings vary.
> - Test capabilities using X3DOM parsing, rendering, serialization.
> - Test capabilities using various Javascript rendering libraries:
> D3.js, three.js, XML3D, webgl source code, etc. All javascript libraries for
> visualization are relevant, important and welcome.
> - Handle multiple comments within a single element
>
> 3. What X3D JSON specification will need to specify:
> http://www.web3d.org/specifications/X3dSpecificationRelationships.png
>
> - Round-trip conversion capability as primary requirement to show that features
> in the X3D Abstract Specification can all be represented in an X3D JSON file.
> - @attributeName prefix using @ character.
> - "#comment" preservation of comments as an allowed option.
> - "#CDATA" preservation of character data as a requirement.
> - Handling of values and arrays for numeric, boolean and string types.
> - Use of "null" (if any).
> - Handling of singleton numeric values, e.g.
> "transparency": 1,
> rather than
> "transparency": [1],
> - Handling of nested vector values in MFVec arrays, for example
> "keyValue": [0, 0, 0, 1, 1, 1, 2, 2, 2],
> (simpler form is a better match for rendering usage)
> or else
> "keyValue": [ [0, 0, 0], [1, 1, 1], [2, 2, 2] ],
> (structured form is easier for programmers to manipulate)
> or perhaps either?
> - Omitting default attribute values allowed?
> - Omitting or including default containerField values? These might be the
> basis for restructuring the JSON to insert explicit containerField values
> prior to each node definition.
> - File extension (.js or .json?) and MIME type
>
> 4. Functional goals and design patterns:
>
> Overview. JSON is a built-in JavaScript object. This works out of the box:
> the parse method simply creates a valid JS object from a JSON string.
> Once that is done, the resulting object tree still has to be traversed
> in order to attach the renderable presentation and behavior if the scene graph.
>
> The exact manner in which an Javascript engine chooses to interpret the JSON and
> render the X3D scenegraph is an independent decision for each Javascript library.
> The JSON representation is only meant to provide the scenegraph for appropriate
> initialization in the 3D engine (and optionally export its state at a given
> moment if needed).
>
> Critical reference: Douglas Crockford book "JavaScript: The Good Parts" from
> O'Reilly and Associates. http://shop.oreilly.com/product/9780596517748.do
>
> Design patterns:
> - Elements and collected attributes are each mapped as JSON objects.
> - Comments are each mapped as JSON objects if parent element has no attributes, otherwise mapped as name:value pair.
> - Non scene-graph nodes (X3D, head, component, meta, unit, Scene) are simple JSON objects.
> - Child scene-graph nodes are mapped as JSON arrays of JSON objects with a single key containerField.
> - Mapping object members to field names ensures key uniqueness.
> - Syntax correctness is testable using jslint http://www.jslint.com
> - Prefixes: @ for attributes, #comment for comments, - for containerField names.
> - JSON requires that float values must have leading zero prior to decimal point, and trailing zero after decimal point.
>
> 5. Specific design goals and use cases include:
> - X3D JSON is written in same javascript language as the rest of the application.
> - it can be optimized with the rest of the application.
> - it can be tested with the rest of the application.
> - it can refer to and interact with non-3D modules (e.g. a third-party library
> for formatting Date timestamps).
> - no eval() method needs to be applied.
> - lightweight to parse.
> - meaningful and low complexity because it's simpler to think with, easier to read,
> easier to diff between two states, and easier to synchronize between devices.
> - easy to require(), to use the same package management as the rest of the
> javascript application code and assets.
> - Easy for programmers to manipulate and adapt.
> - Strive for reusability, avoid hard-wiring the object syntax to one exclusive
> API approach if possible (there are many "similar but different" scene graphs).
> - Future ISO 19776-5 X3D JSON Encoding has to capture everything representable
> in a scene graph defined by the X3D Abstract Specification. Full expressoin
> of all scene graph information is commonly referred to as "round trippable"
> property. The round-trippable requirement is shared by all X3D encodings:
> XML .x3d, ClassicVRML .x3dv, Compressed Binary .x3db.
> - TBD what is use-case requirement for strict or flexible typing of data values?
>
> 6. Issues
> - Can adjacent nodes with identical containerField be collected in single array?
> Biggest example: children nodes within grouping nodes, Scene or ProtoBody.
> Outliers also need to be included - comments, prototypes, ROUTEs etc.
> - Some constructs get presented differently when appearing as a "root" element
> under Scene/ProtoBody as opposed to regular usage within the scene graph.
> Examples include comments, ProtoDeclare, ExternProtoDeclare, ROUTE etc.
> - Round-trip testing .x3d <==> .json needed.
>
> 7. Examples
>
> - TestJsonEncoding.x3d
> http://www.web3d.org/x3d/content/examples/Basic/development/TestJsonEncoding.x3d
> - HelloWorld.json and HelloWorld.scene.json
> http://www.web3d.org/x3d/content/examples/HelloWorld.x3d
> http://www.web3d.org/x3d/content/examples/HelloWorld.json
> - All Web3D archive examples are automatically converted and published:
> http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
> - Need X3DOM examples with corresponding parsing of someScene.json
> - In production: X3D Examples archives.
> http://x3dgraphics.com/examples/X3dForAdvancedModeling
> http://x3dgraphics.com/examples/X3dForWebAuthors
> http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
> - Additional example uses are welcome.
>
> 8. Apparently not possible or not needed.
>
> - Embedded JSON comments are specifically disallowed by JSON specification
> and so round-trippable inclusion must be a custom feature of this encoding.
> http://www.quora.com/How-do-I-write-comments-inside-a-JSON-document
> - No JSON-unique header. Can optionally use X3D/head/meta name=value pairs
> (if capturing full document) or comments in a scene-graph fragment
> or even an X3D Metadata node. However for anything intended to be
> interoperable/reusable, consistency and repeatability is needed.
> Leaving the output JSON as simple as possible avoids code problems and
> provides programmers with the greatest possible flexibility. Further
> analysis will show if a JSON header is needed, probably a non-problem.
> - DOCTYPE information is dropped. This is commonplace for XSLT and does
> not appear to be needed in the JSON encoding. If actually needed by someone,
> such information can be reconstructed simply by using the X3D version number.
> http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Validation
> =======================================================================
-->

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

V.  So, if anyone got this far, one more thing to say.  For me, there is now something pretty clear after this arduous effort:  theory is great but practice is what will matter most in this endeavor.  The great news is that we now have a working encoding for just about all cases - an existence proof, if you will.  Improvements are welcome - but they have to (um, cough cough) actually work too.  We are now in a position to tell very quickly if design variations break the regression testing.

Round tripping with your loader and any other javascript tests will help even further.  Once the encoding pattern is stable, we can revisit the earlier experimental design that Yvonne accomplished in X3DOM and improve/align using that too.

Again thanks for all the work you've done and insights you've shared on this important challenge.

Trick or treat?  Time will tell.  We all get to evaluate examples now.

Have fun with X3D JSON!

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
-------------- next part --------------
[
 { "X3D":[
    {
      "@profile":"Immersive",
      "@version":3.3,
      "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.3.xsd",
      "head":[
          { "meta":
            {
              "@content":"HelloWorld.x3d",
              "@name":"title"
            }
          },
          { "meta":
            {
              "@content":"Simple X3D scene example: Hello World!",
              "@name":"description"
            }
          },
          { "meta":
            {
              "@content":"30 October 2000",
              "@name":"created"
            }
          },
          { "meta":
            {
              "@content":"14 October 2015",
              "@name":"modified"
            }
          },
          { "meta":
            {
              "@content":"Don Brutzman",
              "@name":"creator"
            }
          },
          { "meta":
            {
              "@content":"HelloWorld.tall.png",
              "@name":"Image"
            }
          },
          { "meta":
            {
              "@content":"http://en.wikipedia.org/wiki/Hello_world",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"https://en.wikipedia.org/wiki/Hello#.22Hello.2C_World.22_computer_program",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"https://en.wikipedia.org/wiki/\"Hello,_World!\"_program",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://en.wikibooks.org/w/index.php?title=Computer_Programming/Hello_world",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.HelloWorldExample.net",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.web3D.org",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.web3d.org/realtime-3d/news/internationalization-x3d",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.web3d.org/x3d/content/examples/HelloWorld.x3d",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://X3dGraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01-TechnicalOverview/HelloWorld.x3d",
              "@name":"identifier"
            }
          },
          { "meta":
            {
              "@content":"http://www.web3d.org/x3d/content/examples/license.html",
              "@name":"license"
            }
          },
          { "meta":
            {
              "@content":"X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit",
              "@name":"generator"
            }
          },
          { "#comment":"Alternate encodings: VRML97, X3D ClassicVRML Encoding, X3D Compressed Binary Encoding (CBE), X3DOM, JSON" },
          { "meta":
            {
              "@content":"HelloWorld.wrl",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"HelloWorld.x3dv",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"HelloWorld.x3db",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"HelloWorld.xhtml",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"HelloWorld.json",
              "@name":"reference"
            }
          }
      ],
      "Scene":[
          { "#comment":"Example scene to illustrate X3D nodes and fields (XML elements and attributes)" },
          { "-children":[
              { "WorldInfo":
                {
                  "@title":"Hello world!",
                  "@containerField":"children"
                }
              }
            ]
          },
          { "-children":[
              { "Group":
                {
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "Viewpoint":
                        {
                          "@DEF":"ViewUpClose",
                          "@centerOfRotation":[0, -1, 0],
                          "@description":"Hello world!",
                          "@position":[0, -1, 7],
                          "@fieldOfView":0.7854,
                          "@jump":true,
                          "@orientation":[0, 0, 1, 0],
                          "@retainUserOffsets":false,
                          "@containerField":"children"
                        }
                      }
                    ],
                  "-children":[
                      { "Transform":
                        {
                          "@rotation":[0, 1, 0, 3],
                          "@center":[0, 0, 0],
                          "@scale":[1, 1, 1],
                          "@scaleOrientation":[0, 0, 1, 0],
                          "@translation":[0, 0, 0],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "-children":[
                              { "Shape":
                                {
                                  "@containerField":"children",
                                  "@bboxCenter":[0, 0, 0],
                                  "@bboxSize":[-1, -1, -1],
                                  "-geometry":[
                                      { "Sphere":
                                        {
                                          "@radius":1,
                                          "@solid":true,
                                          "@containerField":"geometry"
                                        }
                                      }
                                    ],
                                  "-appearance":[
                                      { "Appearance":
                                        {
                                          "@containerField":"appearance",
                                          "-material":[
                                              { "Material":
                                                {
                                                  "@DEF":"MaterialLightBlue",
                                                  "@diffuseColor":[0.1, 0.5, 1],
                                                  "@ambientIntensity":0.2,
                                                  "@emissiveColor":[0, 0, 0],
                                                  "@shininess":0.2,
                                                  "@specularColor":[0, 0, 0],
                                                  "@transparency":0,
                                                  "@containerField":"material"
                                                }
                                              }
                                            ],
                                          "-texture":[
                                              { "ImageTexture":
                                                {
                                                  "@DEF":"ImageCloudlessEarth",
                                                  "@url":["earth-topo.png", "earth-topo.jpg", "earth-topo-small.gif", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo.png", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo.jpg", "http://www.web3d.org/x3d/content/examples/Basic/earth-topo-small.gif"],
                                                  "@repeatS":true,
                                                  "@repeatT":true,
                                                  "@containerField":"texture"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "-children":[
                      { "Transform":
                        {
                          "@translation":[0, -2, 0],
                          "@center":[0, 0, 0],
                          "@rotation":[0, 0, 1, 0],
                          "@scale":[1, 1, 1],
                          "@scaleOrientation":[0, 0, 1, 0],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "-children":[
                              { "Shape":
                                {
                                  "@containerField":"children",
                                  "@bboxCenter":[0, 0, 0],
                                  "@bboxSize":[-1, -1, -1],
                                  "-geometry":[
                                      { "Text":
                                        {
                                          "@DEF":"TextMessage",
                                          "@string":["Hello", "world!"],
                                          "@maxExtent":0.0,
                                          "@solid":false,
                                          "@containerField":"geometry",
                                          "-fontStyle":[
                                              { "FontStyle":
                                                {
                                                  "@justify":["MIDDLE", "MIDDLE"],
                                                  "@family":["SERIF"],
                                                  "@horizontal":true,
                                                  "@leftToRight":true,
                                                  "@size":1.0,
                                                  "@spacing":1.0,
                                                  "@style":"PLAIN",
                                                  "@topToBottom":true,
                                                  "@containerField":"fontStyle"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ],
                                  "-appearance":[
                                      { "Appearance":
                                        {
                                          "@containerField":"appearance",
                                          "-material":[
                                              { "Material":
                                                {
                                                  "@USE":"MaterialLightBlue",
                                                  "@containerField":"material"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          }
      ]
    }
  ]
 }
]
-------------- next part --------------
[
 { "X3D":[
    {
      "@profile":"Interchange",
      "@version":3.3,
      "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.3.xsd",
      "head":[
          { "meta":
            {
              "@content":"Dodecahedron.x3d",
              "@name":"title"
            }
          },
          { "meta":
            {
              "@content":"Dodecahedron is a 12-sided polyhedron with 30 edges, 20 vertices and 12 pentagonal faces. A regular dodecahedron is a Platonic solid.",
              "@name":"description"
            }
          },
          { "meta":
            {
              "@content":"13 September 2014",
              "@name":"created"
            }
          },
          { "meta":
            {
              "@content":"27 September 2014",
              "@name":"modified"
            }
          },
          { "meta":
            {
              "@content":"Ben Cheng and Don Brutzman",
              "@name":"creator"
            }
          },
          { "meta":
            {
              "@content":"https://en.wikipedia.org/wiki/Dodecahedron",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"https://en.wiktionary.org/wiki/dodecahedron",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"https://en.wikipedia.org/wiki/Platonic_solid",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://polyhedra.org/poly/show/3/dodecahedron",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.mathsisfun.com/geometry/dodecahedron.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.bodurov.com/VectorVisualizer/?vectors=-0.94/-2.885/-3.975/-1.52/-4.67/-0.94v-3.035/0/-3.975/-4.91/0/-0.94v3.975/-2.885/-0.94/1.52/-4.67/0.94v1.52/-4.67/0.94/-1.52/-4.67/-0.94v0.94/-2.885/3.975/1.52/-4.67/0.94v-3.975/-2.885/0.94/-1.52/-4.67/-0.94v-3.975/-2.885/0.94/-4.91/0/-0.94v-3.975/2.885/0.94/-4.91/0/-0.94v-3.975/2.885/0.94/-1.52/4.67/-0.94v-2.455/1.785/3.975/-3.975/2.885/0.94v-2.455/-1.785/3.975/-3.975/-2.885/0.94v-1.52/4.67/-0.94/-0.94/2.885/-3.975v4.91/0/0.94/3.975/-2.885/-0.94v3.975/2.885/-0.94/2.455/1.785/-3.975v2.455/-1.785/-3.975/3.975/-2.885/-0.94v1.52/4.67/0.94/-1.52/4.67/-0.94v3.035/0/3.975/0.94/2.885/3.975v0.94/2.885/3.975/-2.455/1.785/3.975v-2.455/1.785/3.975/-2.455/-1.785/3.975v-2.455/-1.785/3.975/0.94/-2.885/3.975v0.94/-2.885/3.975/3.035/0/3.975v2.455/1.785/-3.975/-0.94/2.885/-3.975v-0.94/2.885/-3.975/-3.035/0/-3.975v-3.035/0/-3.975/-0.94/-2.885/-3.975v-0.94/-2.885/-3.975/2.455/-1.785/-3.975v2.455/-1.785/-3.975/2.455/1.785/-3.97v3.035/0/3.975/4.91/0/0.94v4.91/0/0.94/3.975/2.885/-0.94v3.975/2.885/-0.94/1.52/4.67/0.94v1.52/4.67/0.94/0.94/2.885/3.975",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.kjmaclean.com/Geometry/dodecahedron.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.georgehart.com/virtual-polyhedra/vp.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.georgehart.com/virtual-polyhedra/vrml/dodecahedron.wrl",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/Dodecahedron.x3d",
              "@name":"identifier"
            }
          },
          { "meta":
            {
              "@content":"Meshlab X3D Exported, http://meshlab.sourceforge.net",
              "@name":"generator"
            }
          },
          { "meta":
            {
              "@content":"X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit",
              "@name":"generator"
            }
          },
          { "meta":
            {
              "@content":"../license.html",
              "@name":"license"
            }
          }
      ],
      "Scene":[
          { "-children":[
              { "Background":
                {
                  "@skyColor":[0.5, 1, 0.9],
                  "@transparency":0,
                  "@containerField":"children"
                }
              }
            ]
          },
          { "-children":[
              { "Viewpoint":
                {
                  "@description":"Dodecahedron",
                  "@position":[0, 0, 4],
                  "@fieldOfView":0.7854,
                  "@jump":true,
                  "@orientation":[0, 0, 1, 0],
                  "@centerOfRotation":[0, 0, 0],
                  "@retainUserOffsets":false,
                  "@containerField":"children"
                }
              }
            ]
          },
          { "-children":[
              { "Shape":
                {
                  "@DEF":"Dodecahedron",
                  "@containerField":"children",
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "-geometry":[
                      { "IndexedFaceSet":
                        {
                          "@coordIndex":[0, 1, 2, -1, 0, 2, 3, -1, 0, 3, 4, -1, 0, 4, 5, -1, 0, 5, 1, -1, 6, 7, 8, -1, 6, 8, 9, -1, 6, 9, 4, -1, 6, 4, 3, -1, 6, 3, 7, -1, 10, 7, 3, -1, 10, 3, 2, -1, 10, 2, 11, -1, 10, 11, 12, -1, 10, 12, 7, -1, 13, 9, 14, -1, 13, 14, 15, -1, 13, 15, 5, -1, 13, 5, 4, -1, 13, 4, 9, -1, 16, 2, 1, -1, 16, 1, 17, -1, 16, 17, 18, -1, 16, 18, 11, -1, 16, 11, 2, -1, 19, 7, 12, -1, 19, 12, 20, -1, 19, 20, 21, -1, 19, 21, 8, -1, 19, 8, 7, -1, 22, 9, 8, -1, 22, 8, 21, -1, 22, 21, 23, -1, 22, 23, 14, -1, 22, 14, 9, -1, 24, 1, 5, -1, 24, 5, 15, -1, 24, 15, 25, -1, 24, 25, 17, -1, 24, 17, 1, -1, 26, 12, 11, -1, 26, 11, 18, -1, 26, 18, 27, -1, 26, 27, 20, -1, 26, 20, 12, -1, 28, 23, 29, -1, 28, 29, 25, -1, 28, 25, 15, -1, 28, 15, 14, -1, 28, 14, 23, -1, 30, 18, 17, -1, 30, 17, 25, -1, 30, 25, 29, -1, 30, 29, 27, -1, 30, 27, 18, -1, 31, 23, 21, -1, 31, 21, 20, -1, 31, 20, 27, -1, 31, 27, 29, -1, 31, 29, 23, -1],
                          "@normalPerVertex":false,
                          "@solid":false,
                          "@ccw":true,
                          "@colorPerVertex":true,
                          "@convex":true,
                          "@creaseAngle":0,
                          "@containerField":"geometry",
                          "-coord":[
                              { "Coordinate":
                                {
                                  "@point":[0.378886, 9.53674e-09, 0.61305, 0.847214, 0, 0.323606, 0.523606, 0.523606, 0.523606, 0, 0.323606, 0.847214, 0, -0.323606, 0.847214, 0.523606, -0.523606, 0.523606, -0.378886, 0, 0.61305, -0.523606, 0.523606, 0.523606, -0.847214, 0, 0.323606, -0.523606, -0.523606, 0.523606, 0, 0.61305, 0.378886, 0.323606, 0.847214, 0, -0.323606, 0.847214, 0, -9.53674e-09, -0.61305, 0.378886, -0.323606, -0.847214, 0, 0.323606, -0.847214, 0, 0.61305, 0.378886, 9.53674e-09, 0.847214, 0, -0.323606, 0.523606, 0.523606, -0.523606, -0.61305, 0.378886, 0, -0.523606, 0.523606, -0.523606, -0.847214, 0, -0.323606, -0.61305, -0.378886, 9.53674e-09, -0.523606, -0.523606, -0.523606, 0.61305, -0.378886, 4.76838e-09, 0.523606, -0.523606, -0.523606, 0, 0.61305, -0.378886, 0, 0.323606, -0.847214, 0, -0.61305, -0.378886, 0, -0.323606, -0.847214, 0.378886, 0, -0.61305, -0.378886, 0, -0.61305],
                                  "@containerField":"coord"
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "-appearance":[
                      { "Appearance":
                        {
                          "@containerField":"appearance",
                          "-material":[
                              { "Material":
                                {
                                  "@diffuseColor":[0.2, 0.5, 0.8],
                                  "@ambientIntensity":0.2,
                                  "@emissiveColor":[0, 0, 0],
                                  "@shininess":0.2,
                                  "@specularColor":[0, 0, 0],
                                  "@transparency":0,
                                  "@containerField":"material"
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          }
      ]
    }
  ]
 }
]
-------------- next part --------------
[
 { "X3D":[
    {
      "@profile":"Immersive",
      "@version":3.3,
      "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.3.xsd",
      "head":[
          { "meta":
            {
              "@content":"ObliqueStrategies.x3d",
              "@name":"title"
            }
          },
          { "meta":
            {
              "@content":"Text scripting and animation example using Oblique Strategies card set by Brian Eno.",
              "@name":"description"
            }
          },
          { "meta":
            {
              "@content":"Don Brutzman, John Kelly, Ben Cheng",
              "@name":"creator"
            }
          },
          { "meta":
            {
              "@content":"3 November 2013",
              "@name":"created"
            }
          },
          { "meta":
            {
              "@content":"18 October 2015",
              "@name":"modified"
            }
          },
          { "meta":
            {
              "@content":"oblique.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"ObliqueStrategies.txt",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"ObliqueStrategiesScript.js",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://music.hyperreal.org/artists/brian_eno/oblique/oblique.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.eno-web.co.uk/obliques.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://gothpunk.com/haiku-intro.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.rtqe.net/ObliqueStrategies/OSintro.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"https://en.wikipedia.org/wiki/Oblique_Strategies",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"Brian Eno, Oblique Strategies",
              "@name":"subject"
            }
          },
          { "meta":
            {
              "@content":"images/ObliqueStrategiesEntryScreen.png",
              "@name":"Image"
            }
          },
          { "meta":
            {
              "@content":"http://translate.google.com/translate_tts?tl=en&q=hello%20X3D",
              "@name":"audio"
            }
          },
          { "meta":
            {
              "@content":"translate_tts_HelloX3D.mp3",
              "@name":"audio"
            }
          },
          { "meta":
            {
              "@content":"translate_tts_HelloX3D.wav",
              "@name":"audio"
            }
          },
          { "meta":
            {
              "@content":"multiliingual translation parameter",
              "@name":"TODO"
            }
          },
          { "meta":
            {
              "@content":"http://stackoverflow.com/questions/9163988/download-mp3-from-google-translate-text-to-speech",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"http://www.greenbot.com/article/2105862/how-to-get-started-with-google-text-to-speech.html",
              "@name":"reference"
            }
          },
          { "meta":
            {
              "@content":"under development, scene Sound/AudioClip triggering (or retrieved file format) not working",
              "@name":"warning"
            }
          },
          { "meta":
            {
              "@content":"BSContact error: Script node TextScript: parse error: line 15 \" var strategy = [];",
              "@name":"warning"
            }
          },
          { "meta":
            {
              "@content":"http://X3dGraphics.com/examples/X3dForAdvancedModeling/Inspiration/ObliqueStrategies.x3d",
              "@name":"identifier"
            }
          },
          { "meta":
            {
              "@content":"X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit",
              "@name":"generator"
            }
          },
          { "meta":
            {
              "@content":"../license.html",
              "@name":"license"
            }
          }
      ],
      "Scene":[
          { "-children":[
              { "NavigationInfo":
                {
                  "@type":["NONE"],
                  "@avatarSize":[0.25, 1.6, 0.75],
                  "@headlight":true,
                  "@speed":1,
                  "@transitionType":["LINEAR"],
                  "@transitionTime":1.0,
                  "@visibilityLimit":0,
                  "@containerField":"children"
                }
              }
            ]
          },
          { "-children":[
              { "Background":
                {
                  "@skyColor":[0.419608, 0.427451, 1],
                  "@transparency":0,
                  "@containerField":"children"
                }
              }
            ]
          },
          { "-children":[
              { "Transform":
                {
                  "@scale":[0.4, 0.4, 0.4],
                  "@translation":[0, 1, 0],
                  "@center":[0, 0, 0],
                  "@rotation":[0, 0, 1, 0],
                  "@scaleOrientation":[0, 0, 1, 0],
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "TouchSensor":
                        {
                          "@DEF":"RandomTextClickedSensor",
                          "@description":"Select to see a new strategy",
                          "@enabled":true,
                          "@containerField":"children"
                        }
                      }
                    ],
                  "-children":[
                      { "Shape":
                        {
                          "@containerField":"children",
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "-geometry":[
                              { "Text":
                                {
                                  "@string":["Oblique, Strategies", "", "(Over, One, Hundred, Worthwhile, Dilemmas)", "", "by, Brian, Eno, and, Peter, Schmidt"],
                                  "@maxExtent":0.0,
                                  "@solid":false,
                                  "@containerField":"geometry",
                                  "-fontStyle":[
                                      { "FontStyle":
                                        {
                                          "@DEF":"MessageFont",
                                          "@family":["SANS"],
                                          "@justify":["MIDDLE", "MIDDLE"],
                                          "@style":"BOLD",
                                          "@horizontal":true,
                                          "@leftToRight":true,
                                          "@size":1.0,
                                          "@spacing":1.0,
                                          "@topToBottom":true,
                                          "@containerField":"fontStyle"
                                        }
                                      }
                                    ]
                                }
                              }
                            ],
                          "-appearance":[
                              { "Appearance":
                                {
                                  "@containerField":"appearance",
                                  "-material":[
                                      { "Material":
                                        {
                                          "@diffuseColor":[1, 1, 1],
                                          "@ambientIntensity":0.2,
                                          "@emissiveColor":[0, 0, 0],
                                          "@shininess":0.2,
                                          "@specularColor":[0, 0, 0],
                                          "@transparency":0,
                                          "@containerField":"material"
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "-children":[
                      { "Transform":
                        {
                          "@scale":[10, 3, 1],
                          "@center":[0, 0, 0],
                          "@rotation":[0, 0, 1, 0],
                          "@scaleOrientation":[0, 0, 1, 0],
                          "@translation":[0, 0, 0],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "-children":[
                              { "Shape":
                                {
                                  "@DEF":"HeadlineClickSurface",
                                  "@containerField":"children",
                                  "@bboxCenter":[0, 0, 0],
                                  "@bboxSize":[-1, -1, -1],
                                  "-geometry":[
                                      { "IndexedFaceSet":
                                        {
                                          "@coordIndex":[0, 1, 2, 3, -1],
                                          "@solid":false,
                                          "@ccw":true,
                                          "@colorPerVertex":true,
                                          "@convex":true,
                                          "@creaseAngle":0,
                                          "@normalPerVertex":true,
                                          "@containerField":"geometry",
                                          "-coord":[
                                              { "Coordinate":
                                                {
                                                  "@point":[1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0],
                                                  "@containerField":"coord"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ],
                                  "-appearance":[
                                      { "Appearance":
                                        {
                                          "@containerField":"appearance",
                                          "-material":[
                                              { "Material":
                                                {
                                                  "@ambientIntensity":0.245763,
                                                  "@diffuseColor":[0.34773, 0.090909, 0.005289],
                                                  "@shininess":0.07,
                                                  "@specularColor":[0.336735, 0.051091, 0.051091],
                                                  "@transparency":0.8,
                                                  "@emissiveColor":[0, 0, 0],
                                                  "@containerField":"material"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          },
          { "-children":[
              { "Script":
                {
                  "@DEF":"TextScript",
                  "@url":["ObliqueStrategiesScript.js", "http://X3dGraphics.com/examples/X3dForAdvancedModeling/Inspiration/ObliqueStrategiesScript.js"],
                  "@directOutput":false,
                  "@mustEvaluate":false,
                  "@containerField":"children",
                  "#comment":"initialize() method includes unit test to printAllStrategies() to console",
                  "#comment":"TODO insert field definitions here (index string_changed previous next random) and then animate!",
                  "field:index":
                  {
                    "@accessType":"initializeOnly",
                    "@appinfo":"index for active strategy card, -1 means no selection",
                    "@name":"index",
                    "@type":"SFInt32",
                    "@value":0
                  },
                  "field:string_changed":
                  {
                    "@accessType":"outputOnly",
                    "@appinfo":"latest strategy card value",
                    "@name":"string_changed",
                    "@type":"MFString"
                  },
                  "field:textToSpeechUrl":
                  {
                    "@accessType":"outputOnly",
                    "@appinfo":"url to invoke Google Translate",
                    "@name":"textToSpeechUrl",
                    "@type":"MFString"
                  },
                  "field:newCardTime":
                  {
                    "@accessType":"outputOnly",
                    "@appinfo":"activate Sound node",
                    "@name":"newCardTime",
                    "@type":"SFTime"
                  },
                  "field:selectPreviousCard":
                  {
                    "@accessType":"inputOnly",
                    "@name":"selectPreviousCard",
                    "@type":"SFBool"
                  },
                  "field:selectNextCard":
                  {
                    "@accessType":"inputOnly",
                    "@name":"selectNextCard",
                    "@type":"SFBool"
                  },
                  "field:selectRandomCard":
                  {
                    "@accessType":"inputOnly",
                    "@name":"selectRandomCard",
                    "@type":"SFBool"
                  },
                  "field:traceEnabled":
                  {
                    "@accessType":"initializeOnly",
                    "@appinfo":"controls console tracing",
                    "@name":"traceEnabled",
                    "@type":"SFBool",
                    "@value":true
                  }
                }
              }
            ]
          },
          { "-children":[
              { "Transform":
                {
                  "@DEF":"CardTransform",
                  "@scale":[0.4, 0.4, 0.4],
                  "@translation":[0, -1.5, 0],
                  "@center":[0, 0, 0],
                  "@rotation":[0, 0, 1, 0],
                  "@scaleOrientation":[0, 0, 1, 0],
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "Shape":
                        {
                          "@containerField":"children",
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "-geometry":[
                              { "Text":
                                {
                                  "@DEF":"CardText",
                                  "@maxExtent":0.0,
                                  "@solid":false,
                                  "@containerField":"geometry",
                                  "-fontStyle":[
                                      { "FontStyle":
                                        {
                                          "@family":["SANS"],
                                          "@justify":["MIDDLE", "MIDDLE"],
                                          "@style":"BOLD",
                                          "@horizontal":true,
                                          "@leftToRight":true,
                                          "@size":1.0,
                                          "@spacing":1.0,
                                          "@topToBottom":true,
                                          "@containerField":"fontStyle"
                                        }
                                      }
                                    ]
                                }
                              }
                            ],
                          "-appearance":[
                              { "Appearance":
                                {
                                  "@containerField":"appearance",
                                  "-material":[
                                      { "Material":
                                        {
                                          "@diffuseColor":[1, 1, 1],
                                          "@ambientIntensity":0.2,
                                          "@emissiveColor":[0, 0, 0],
                                          "@shininess":0.2,
                                          "@specularColor":[0, 0, 0],
                                          "@transparency":0,
                                          "@containerField":"material"
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "ROUTE":
                    {
                      "@fromField":"string_changed",
                      "@fromNode":"TextScript",
                      "@toField":"string",
                      "@toNode":"CardText"
                    },
                  "-children":[
                      { "Sound":
                        {
                          "@DEF":"CardSoundSpatialization",
                          "@maxBack":100,
                          "@maxFront":100,
                          "@minBack":20,
                          "@minFront":20,
                          "@direction":[0, 0, 1],
                          "@intensity":1,
                          "@location":[0, 0, 0],
                          "@priority":0,
                          "@spatialize":true,
                          "@containerField":"children",
                          "#comment":"Make sure the sound source AudioClip is audible at the user location",
                          "#comment":"Not all X3D players seem to use the .mp3",
                          "#comment":"& is ampersand character, avoids escaping problems and inconsistencies in browsers and X3D players",
                          "#comment":"%20 is space character used in uri/url encoding",
                          "-source":[
                              { "AudioClip":
                                {
                                  "@DEF":"TextToSpeechAudioClip",
                                  "@description":"sends strategy text google translate",
                                  "@url":["http://translate.google.com/translate_tts?tl=en&q=Feed%20the%20recording%20back%20out%20of%20the%20medium", "translate_tts_mp3FileFormatNotSupported.wav", "http://X3dGraphics.com/examples/X3dForAdvancedModeling/Inspiration/translate_tts_mp3FileFormatNotSupported.wav"],
                                  "@loop":false,
                                  "@pitch":1.0,
                                  "@startTime":0,
                                  "@stopTime":0,
                                  "@pauseTime":0,
                                  "@resumeTime":0,
                                  "@containerField":"source"
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "ROUTE":
                    {
                      "@fromField":"textToSpeechUrl",
                      "@fromNode":"TextScript",
                      "@toField":"url",
                      "@toNode":"TextToSpeechAudioClip"
                    },
                  "ROUTE":
                    {
                      "@fromField":"newCardTime",
                      "@fromNode":"TextScript",
                      "@toField":"startTime",
                      "@toNode":"TextToSpeechAudioClip"
                    }
                }
              }
            ]
          },
          { "-children":[
              { "Transform":
                {
                  "@scale":[0.4, 0.4, 0.4],
                  "@translation":[-3.2, 2.5, 0],
                  "@center":[0, 0, 0],
                  "@rotation":[0, 0, 1, 0],
                  "@scaleOrientation":[0, 0, 1, 0],
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "TouchSensor":
                        {
                          "@DEF":"PreviousTextClickedSensor",
                          "@description":"Select to see previous strategy",
                          "@enabled":true,
                          "@containerField":"children"
                        }
                      }
                    ],
                  "ROUTE":
                    {
                      "@fromField":"isActive",
                      "@fromNode":"PreviousTextClickedSensor",
                      "@toField":"selectPreviousCard",
                      "@toNode":"TextScript"
                    },
                  "-children":[
                      { "Shape":
                        {
                          "@containerField":"children",
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "-geometry":[
                              { "Text":
                                {
                                  "@string":["previous"],
                                  "@maxExtent":0.0,
                                  "@solid":false,
                                  "@containerField":"geometry",
                                  "-fontStyle":[
                                      { "FontStyle":
                                        {
                                          "@USE":"MessageFont",
                                          "@containerField":"fontStyle"
                                        }
                                      }
                                    ]
                                }
                              }
                            ],
                          "-appearance":[
                              { "Appearance":
                                {
                                  "@DEF":"InterfaceAppearance",
                                  "@containerField":"appearance",
                                  "-material":[
                                      { "Material":
                                        {
                                          "@diffuseColor":[1, 0, 0.6],
                                          "@ambientIntensity":0.2,
                                          "@emissiveColor":[0, 0, 0],
                                          "@shininess":0.2,
                                          "@specularColor":[0, 0, 0],
                                          "@transparency":0,
                                          "@containerField":"material"
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "-children":[
                      { "Transform":
                        {
                          "@scale":[2, 0.6, 1],
                          "@center":[0, 0, 0],
                          "@rotation":[0, 0, 1, 0],
                          "@scaleOrientation":[0, 0, 1, 0],
                          "@translation":[0, 0, 0],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "-children":[
                              { "Shape":
                                {
                                  "@DEF":"TransparentClickSurface",
                                  "@containerField":"children",
                                  "@bboxCenter":[0, 0, 0],
                                  "@bboxSize":[-1, -1, -1],
                                  "#comment":"support Selectable Text with a scalable IFS",
                                  "-geometry":[
                                      { "IndexedFaceSet":
                                        {
                                          "@coordIndex":[0, 1, 2, 3, -1],
                                          "@solid":false,
                                          "@ccw":true,
                                          "@colorPerVertex":true,
                                          "@convex":true,
                                          "@creaseAngle":0,
                                          "@normalPerVertex":true,
                                          "@containerField":"geometry",
                                          "-coord":[
                                              { "Coordinate":
                                                {
                                                  "@point":[1, 1, 0, 1, -1, 0, -1, -1, 0, -1, 1, 0],
                                                  "@containerField":"coord"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ],
                                  "-appearance":[
                                      { "Appearance":
                                        {
                                          "@containerField":"appearance",
                                          "-material":[
                                              { "Material":
                                                {
                                                  "@transparency":1,
                                                  "@ambientIntensity":0.2,
                                                  "@diffuseColor":[0.8, 0.8, 0.8],
                                                  "@emissiveColor":[0, 0, 0],
                                                  "@shininess":0.2,
                                                  "@specularColor":[0, 0, 0],
                                                  "@containerField":"material"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          },
          { "-children":[
              { "Transform":
                {
                  "@scale":[0.4, 0.4, 0.4],
                  "@translation":[3.5, 2.5, 0],
                  "@center":[0, 0, 0],
                  "@rotation":[0, 0, 1, 0],
                  "@scaleOrientation":[0, 0, 1, 0],
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "TouchSensor":
                        {
                          "@DEF":"NextTextClickedSensor",
                          "@description":"Select to see next strategy",
                          "@enabled":true,
                          "@containerField":"children"
                        }
                      }
                    ],
                  "ROUTE":
                    {
                      "@fromField":"isActive",
                      "@fromNode":"NextTextClickedSensor",
                      "@toField":"selectNextCard",
                      "@toNode":"TextScript"
                    },
                  "-children":[
                      { "Shape":
                        {
                          "@containerField":"children",
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "-geometry":[
                              { "Text":
                                {
                                  "@string":["next"],
                                  "@maxExtent":0.0,
                                  "@solid":false,
                                  "@containerField":"geometry",
                                  "-fontStyle":[
                                      { "FontStyle":
                                        {
                                          "@USE":"MessageFont",
                                          "@containerField":"fontStyle"
                                        }
                                      }
                                    ]
                                }
                              }
                            ],
                          "-appearance":[
                              { "Appearance":
                                {
                                  "@USE":"InterfaceAppearance",
                                  "@containerField":"appearance"
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "-children":[
                      { "Transform":
                        {
                          "@scale":[1.2, 0.6, 1],
                          "@center":[0, 0, 0],
                          "@rotation":[0, 0, 1, 0],
                          "@scaleOrientation":[0, 0, 1, 0],
                          "@translation":[0, 0, 0],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "-children":[
                              { "Shape":
                                {
                                  "@USE":"TransparentClickSurface",
                                  "@containerField":"children"
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          },
          { "-children":[
              { "Transform":
                {
                  "@scale":[0.4, 0.4, 0.4],
                  "@translation":[-3.3, -0.5, 0],
                  "@center":[0, 0, 0],
                  "@rotation":[0, 0, 1, 0],
                  "@scaleOrientation":[0, 0, 1, 0],
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "TouchSensor":
                        {
                          "@USE":"RandomTextClickedSensor",
                          "@containerField":"children"
                        }
                      }
                    ],
                  "ROUTE":
                    {
                      "@fromField":"isActive",
                      "@fromNode":"RandomTextClickedSensor",
                      "@toField":"selectRandomCard",
                      "@toNode":"TextScript"
                    },
                  "-children":[
                      { "Shape":
                        {
                          "@containerField":"children",
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "-geometry":[
                              { "Text":
                                {
                                  "@string":["random"],
                                  "@maxExtent":0.0,
                                  "@solid":false,
                                  "@containerField":"geometry",
                                  "-fontStyle":[
                                      { "FontStyle":
                                        {
                                          "@USE":"MessageFont",
                                          "@containerField":"fontStyle"
                                        }
                                      }
                                    ]
                                }
                              }
                            ],
                          "-appearance":[
                              { "Appearance":
                                {
                                  "@USE":"InterfaceAppearance",
                                  "@containerField":"appearance"
                                }
                              }
                            ]
                        }
                      }
                    ],
                  "-children":[
                      { "Transform":
                        {
                          "@scale":[1.8, 0.6, 1],
                          "@center":[0, 0, 0],
                          "@rotation":[0, 0, 1, 0],
                          "@scaleOrientation":[0, 0, 1, 0],
                          "@translation":[0, 0, 0],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "-children":[
                              { "Shape":
                                {
                                  "@USE":"TransparentClickSurface",
                                  "@containerField":"children"
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          },
          { "-children":[
              { "Transform":
                {
                  "@scale":[0.4, 0.4, 0.4],
                  "@translation":[3.3, -0.5, 0],
                  "@center":[0, 0, 0],
                  "@rotation":[0, 0, 1, 0],
                  "@scaleOrientation":[0, 0, 1, 0],
                  "@bboxCenter":[0, 0, 0],
                  "@bboxSize":[-1, -1, -1],
                  "@containerField":"children",
                  "-children":[
                      { "Anchor":
                        {
                          "@DEF":"TextToSpeechAnchor",
                          "@description":"text to speech in browser",
                          "@parameter":["target=_blank"],
                          "@url":["http://translate.google.com/translate_tts?tl=en&q=Overtly%20resist%20change"],
                          "@bboxCenter":[0, 0, 0],
                          "@bboxSize":[-1, -1, -1],
                          "@containerField":"children",
                          "ROUTE":
                            {
                              "@fromField":"textToSpeechUrl",
                              "@fromNode":"TextScript",
                              "@toField":"url",
                              "@toNode":"TextToSpeechAnchor"
                            },
                          "-children":[
                              { "Shape":
                                {
                                  "@containerField":"children",
                                  "@bboxCenter":[0, 0, 0],
                                  "@bboxSize":[-1, -1, -1],
                                  "-geometry":[
                                      { "Text":
                                        {
                                          "@string":["speech"],
                                          "@maxExtent":0.0,
                                          "@solid":false,
                                          "@containerField":"geometry",
                                          "-fontStyle":[
                                              { "FontStyle":
                                                {
                                                  "@USE":"MessageFont",
                                                  "@containerField":"fontStyle"
                                                }
                                              }
                                            ]
                                        }
                                      }
                                    ],
                                  "-appearance":[
                                      { "Appearance":
                                        {
                                          "@USE":"InterfaceAppearance",
                                          "@containerField":"appearance"
                                        }
                                      }
                                    ]
                                }
                              }
                            ],
                          "-children":[
                              { "Transform":
                                {
                                  "@scale":[1.8, 0.6, 1],
                                  "@center":[0, 0, 0],
                                  "@rotation":[0, 0, 1, 0],
                                  "@scaleOrientation":[0, 0, 1, 0],
                                  "@translation":[0, 0, 0],
                                  "@bboxCenter":[0, 0, 0],
                                  "@bboxSize":[-1, -1, -1],
                                  "@containerField":"children",
                                  "-children":[
                                      { "Shape":
                                        {
                                          "@USE":"TransparentClickSurface",
                                          "@containerField":"children"
                                        }
                                      }
                                    ]
                                }
                              }
                            ]
                        }
                      }
                    ]
                }
              }
            ]
          }
      ]
    }
  ]
 }
]


More information about the x3d-public mailing list