X3D to VRML 97 Translation Examples

Don Brutzman (brutzman@nps.navy.mil)

Warning: copied examples on this page are old and now noncompliant. This examples page is retained for archival purposes.

Please see the Help page for links to over 2000 valid examples.

VRML 97 Specification Examples | GeoVrml Profile Examples | H-Anim Profile Examples
AllVrml97Nodes | AmelaExampleScene | BradenProtoInitializeExample | CoreProfileExample
ECMAScriptAnnexExample2 | ExampleExternProto-1 | ExampleExternProto-2
ExampleOrientationInterpolationSpinner | GeoVrmlExample1 | HelloWorld | newScene
Orbiter | ProtoInstanceExample | ProtoTagDtdDeclarationExamples | ProxyShapeExample
QuadTreeExamples | ScriptExample | ShapeChildRoutingExample |
SpinGroupInternalSubsetDeclaration | WrapperTagsExample | X3dRetreatProtoExercise

Bonus work now available: VRML 2.0 Sourcebook Examples provides 270 new X3D scenes. These are all translated with permission from the VRML 2.0 Sourcebook by Andrea L. Ames, David R. Nadeau and John L. Moreland.

These examples were produced using the following tag definitions and open-source software:

The X3D-Edit and X3D-Examples distributions are available here:

To-do list:

References:


  1. VRML 97 Specification Examples provides X3D (and then back-to-VRML) translations of all example scenes from Annex D in the VRML 97 specification.

    Explanation of filename conventions:

    These manually translated and autotranslated examples demonstrate that X3D can represent the full functionality of VRML 97. Further work on examples validation is being undertaken using the NIST conformance suite.

    D.1 Introduction Original specification example in VRML
    Double-translation back to VRML
    Translated/authored XML version
    Pretty-printed HTML of XML version
    D.2 Simple example exampleD_2.wrl
    exampleD_2TranslatedTranslated.wrl
    exampleD_2Translated.xml
    exampleD_2TranslatedStyled.html
    D.3 Instancing (sharing) exampleD_3.wrl
    exampleD_3TranslatedTranslated.wrl
    exampleD_3Translated.xml
    exampleD_3TranslatedStyled.html
    D.4 Prototype example exampleD_4.wrl
    exampleD_4AuthoredX3dTranslated.wrl
    exampleD_4AuthoredX3d.xml
    exampleD_4AuthoredX3dStyled.html
    D.5 Scripting example exampleD_5.wrl
    exampleD_5AuthoredX3dTranslated.wrl
    exampleD_5AuthoredX3d.xml
    exampleD_5AuthoredX3dStyled.html
    D.6 Geometric properties exampleD_6.wrl
    exampleD_6AuthoredX3dTranslated.wrl
    exampleD_6AuthoredX3d.xml
    exampleD_6AuthoredX3dStyled.html
    D.7 Prototypes and alternate representations exampleD_7.wrl
    exampleD_7AuthoredX3dTranslated.wrl
    exampleD_7AuthoredX3d.xml
    exampleD_7AuthoredX3dStyled.html
    D.8 Anchor exampleD_8.wrl
    exampleD_8AuthoredX3dTranslated.wrl
    exampleD_8AuthoredX3d.xml
    exampleD_8AuthoredX3dStyled.html
    D.9 Directional light exampleD_9.wrl
    exampleD_9TranslatedTranslated.wrl
    exampleD_9Translated.xml
    exampleD_9TranslatedStyled.html
    D.10 PointSet exampleD_10.wrl
    exampleD_10TranslatedTranslated.wrl
    exampleD_10Translated.xml
    exampleD_10TranslatedStyled.html
    D.11 Level of detail exampleD_11.wrl
    exampleD_11TranslatedTranslated.wrl
    exampleD_11Translated.xml
    exampleD_11TranslatedStyled.html
    D.12 Color interpolator exampleD_12.wrl
    exampleD_12TranslatedTranslated.wrl
    exampleD_12Translated.xml
    exampleD_12TranslatedStyled.html
    D.13 TimeSensor,
    D.13.1 Introduction,
    D.13.2 Click to animate
    exampleD_13_2.wrl
    exampleD_13_2TranslatedTranslated.wrl
    exampleD_13_2Translated.xml
    exampleD_13_2TranslatedStyled.html
    D.13.3 Alarm clock (sound only, no geometry) exampleD_13_3.wrl
    exampleD_13_3TranslatedTranslated.wrl
    exampleD_13_3Translated.xml
    exampleD_13_3TranslatedStyled.html
    D.14 Shuttles and pendulums exampleD_14.wrl
    exampleD_14AuthoredX3dTranslated.wrl
    exampleD_14AuthoredX3d.xml
    exampleD_14AuthoredX3dStyled.html
    D.15 Robot exampleD_15.wrl
    exampleD_15AuthoredX3dTranslated.wrl
    exampleD_15AuthoredX3d.xml
    exampleD_15AuthoredX3dStyled.html
    D.16 Chopper exampleD_16.wrl
    exampleD_16AuthoredX3dTranslated.wrl
    exampleD_16AuthoredX3d.xml
    exampleD_16AuthoredX3dStyled.html
       D.16 Rotor (PROTO definition, not visible) rotor.wrl
    rotorAuthoredX3dTranslated.wrl
    rotorAuthoredX3d.xml
    rotorAuthoredX3dStyled.html
       D.16 Chopper body chopperbody.wrl
    chopperbodyTranslatedTranslated.wrl
    chopperbodyTranslated.xml
    chopperbodyTranslatedStyled.html
       D.16 Chopper rotor chopperrotor.wrl
    chopperrotorTranslatedTranslated.wrl
    chopperrotorTranslated.xml
    chopperrotorTranslatedStyled.html
    D.17 Guided tour exampleD_17.wrl
    exampleD_17TranslatedTranslated.wrl
    exampleD_17Translated.xml
    exampleD_17TranslatedStyled.html
    D.18 Elevator exampleD_18.wrl
    exampleD_18TranslatedTranslated.wrl
    exampleD_18Translated.xml
    exampleD_18TranslatedStyled.html
    D.19 Execution mode exampleD_19.wrl
    exampleD_19AuthoredX3dTranslated.wrl
    exampleD_19AuthoredX3d.xml
    exampleD_19AuthoredX3dStyled.html


  2. GeoVrml Profile Examples demonstrate implementation of the GeoVrml 1.0 Specification as an X3D Profile.

    To view these georeferenced examples, you must first download and install the GeoVrml runtime.

    GeoVrml Examples Original specification example in VRML
    Double-translation back to VRML
    Translated/authored XML version
    Pretty-printed HTML of XML version
    A.1 GeoElevationGrid Example exagearth.wrl
    A1_GeoElevationGrid.wrl
    A1_GeoElevationGrid.xml
    A1_GeoElevationGridStyled.html
    A.2 Animated GeoViewpoint Example viewanim.wrl
    A2_AnimatedGeoViewpoint.wrl
    A2_AnimatedGeoViewpoint.xml
    A2_AnimatedGeoViewpoint.html
    A.3 GeoInline Example geoinline.wrl
    A3_GeoInline.wrl
    A3_GeoInline.xml
    A3_GeoInline.html
    A.4 GeoLocation Example geoloc.wrl
    A4_GeoLocation.wrl
    A4_GeoLocation.xml
    A4_GeoLocation.html
    A.5 GeoOrigin Example geoorigin.wrl
    A5_GeoOrigin.wrl
    A5_GeoOrigin.xml
    A5_GeoOrigin.html
    Temple Example temple_origin.wrl
    temple.wrl
    temple.xml
    temple.html

    The following newGeoVrmlScene.xml is a simple, non-rendering scene that includes examples of all GeoVrml nodes. It can be used as a template for new scenes.

    The following GeoVrmlExternProtos.xml used to be necessary for proper inclusion of GeoVrml EXTERNPROTOs when translating back to VRML 97. It is no longer needed, since the X3dToVrml97.xsl translation stylesheet automatically includes such embedded definitions as part of full GeoVRML Profile support.


  3. Humanoid Animation (H-Anim) Profile Examples demonstrate implementation of the H-Anim 1.1 Specification as an X3D Profile.

    X3D encoding of the H-Anim 1.1 extension is complete.

    H-Anim Examples Original specification example in VRML
    Double-translation back to VRML
    Translated/authored XML version
    Pretty-printed HTML of XML version
    Nancy Example - PROTOs nancy_h-anim.wrl
    NancyProtos.wrl
    NancyProtos.xml
    NancyProtos.html
    Nancy Example - Native Tags and EXTERNPROTOS nancy_h-anim.wrl
    NancyNativeTags.wrl
    NancyNativeTags.xml
    NancyNativeTags.html


  4. AllVrml97Nodes is a large scene that includes all of the nodes in the VRML 97 specification. The source and translations are not reproduced in HTML here due to length.

    Note that this file is not designed to present a 3D scene that looks like anything real! It is merely an enumeration of all VRML 97 nodes and fields for translation testing purposes.


  5. AmelaExampleScene is a typical demo example to show how to build an X3D scene.

    AmelaExampleScene.xml, AmelaExampleScene.html AmelaExampleScene.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='AmelaExampleScene.xml'/> <meta name='description' content='Amela example test file, VRST 99'/> <meta name='revised' content='29 January 2000'/> <meta name='author' content='Don Brutzman'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/AmelaExampleScene.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Group>
    <children>
    <Shape>
    <appearance>
    <Appearance>
    <material>
    <Material diffuseColor='.9 .9 .9'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Cylinder/>
    </geometry>
    </Shape>
    </children>
    </Group> <Transform translation='0 -2 4'>
    <children>
    <Shape>
    <appearance>
    <Appearance>
    <material>
    <Material emissiveColor='0 0 0.8'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Sphere radius='.2'/>
    </geometry>
    </Shape> <PointLight DEF='MyPointLight' color='0 0 1' on='false'/>
    </children>
    </Transform> <TouchSensor DEF='MyTouchSensor'/> <NavigationInfo type='"EXAMINE" "ANY"'/> <ROUTE fromField='isOver' fromNode='MyTouchSensor' toField='on' toNode='MyPointLight'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: AmelaExampleScene.xml
    # [meta] description: Amela example test file, VRST 99
    # [meta] revised: 29 January 2000
    # [meta] author: Don Brutzman
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/AmelaExampleScene.xml
    # [meta] generator: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    Group {
      children [
        Shape {
          appearance Appearance {
    	material Material {
    	  diffuseColor .9 .9 .9
    	}
          }
          geometry Cylinder {
          }
        }
      ]
    }
    Transform {
      children [
        Shape {
          appearance Appearance {
    	material Material {
    	  emissiveColor 0 0 0.8
    	}
          }
          geometry Sphere {
    	radius .2
          }
        }
        DEF MyPointLight PointLight {
          color 0 0 1
          on FALSE
        }
      ]
      translation 0 -2 4
    }
    DEF MyTouchSensor TouchSensor {
    }
    NavigationInfo {
      type [ "EXAMINE" "ANY" ]
    }
    ROUTE MyTouchSensor.isOver TO MyPointLight.on
    


  6. BradenProtoInitializeExample is a simple PROTO node-initialization example: the red Material node is carried as a default node value inside the ProtoDeclaration, then instantiated in the ProtoInstance. Seeing a red Sphere shows that the example works (failure to initialize would result in a grey Sphere).

    BradenProtoInitializeExample.xml, BradenProtoInitializeExample.html BradenProtoInitializeExample.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='BradenProtoInitializeExample.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='5 March 2000'/> <meta name='description' content='answer to email question'/> <meta name='url' content='*enter url address here*'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <ProtoDeclare name='Foo'>
    <field IS='FOO_APPEARANCE.material' name='node' type='Node'>
    <Material diffuseColor='1 0 0'/>
    </field> <Shape>
    <appearance>
    <Appearance DEF='FOO_APPEARANCE'/>
    </appearance> <geometry>
    <Sphere/>
    </geometry>
    </Shape>
    </ProtoDeclare> <ProtoInstance name='Foo'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: BradenProtoInitializeExample.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 5 March 2000
    # [meta] description: answer to email question
    # [meta] url: *enter url address here*
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    PROTO Foo [
      exposedField SFNode node Material {
        diffuseColor 1 0 0
      }
      # IS FOO_APPEARANCE.material
    ] {
      Shape {
        appearance DEF FOO_APPEARANCE Appearance {
          material IS node
        }
        geometry Sphere {
        }
      }
    }
    Foo {
    }
    


  7. CoreProfileExample shows how to invoke the Core Profile in the DTD. Parameter entity definitions in the DTD fragment at the top of the .xml file set & reset switches in the DTD corresponding to Core Profile rules. Any fields or nodes not in the Core Profile are flagged as errors. All fields and nodes in the Core Profile are identical with the superset VRML 97 Profile. An example X3D-Edit screen snapshot is also available.

    (Note that DTD-fragment prolog sections are not always presented by XML viewers, you may need to view the XML source.)

    CoreProfileExample.xml, CoreProfileExample.html CoreProfileExample.wrl
    
    <?xml version="1.0" encoding="utf-8" ?>
    <!DOCTYPE X3D PUBLIC
    	"http://www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    	"file://localhost/C:/www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd" [
     <!ENTITY % Vrml97Profile  "IGNORE">
     <!ENTITY % CoreProfile    "INCLUDE">
     <!ENTITY % X3dExtensions  "IGNORE">
     <!ENTITY % GeoVrmlProfile "IGNORE">
    ]>
    
    <X3D>
    
    <head>
    <meta name='filename' content='CoreProfileExample.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='17 January 2000'/> <meta name='description' content='Demonstrate strictly compliant Core profile scene. Core profile is defined in draft specification at http://www.web3d.org/TaskGroups/x3d/specification/part1/CoreProfile.html'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/CoreProfileExample.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Anchor url='http://www.web3D.org'>
    <children>
    <Shape>
    <appearance>
    <Appearance>
    <material>
    <Material/>
    </material> <texture>
    <ImageTexture url='someImage.jpg someImage.png'/>
    </texture>
    </Appearance>
    </appearance> <geometry>
    <IndexedFaceSet creaseAngle='3.14159'>
    <color>
    <Color/>
    </color>
    </IndexedFaceSet>
    </geometry>
    </Shape> <Shape>
    <geometry>
    <IndexedLineSet/>
    </geometry>
    </Shape> <Shape>
    <geometry>
    <PointSet/>
    </geometry>
    </Shape>
    </children>
    </Anchor> <Background skyColor='0.0 0.2 0.7'/> <CoordinateInterpolator/> <DirectionalLight/> <Group/> <Inline/> <NavigationInfo/> <OrientationInterpolator/> <PositionInterpolator DEF='PI'/> <ScalarInterpolator/> <TimeSensor DEF='TS'/> <TouchSensor/> <Transform/> <Viewpoint/> <WorldInfo/> <ROUTE fromField='fraction_changed' fromNode='TS' toField='set_fraction' toNode='PI'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: CoreProfileExample.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 17 January 2000
    # [meta] description: Demonstrate strictly compliant Core profile scene.
    #        Core profile is defined in draft specification at
    #        http://www.web3d.org/TaskGroups/x3d/specification/part1/CoreProfile.html
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/CoreProfileExample.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    Anchor {
      url [ "http://www.web3D.org" ]
      children [
        Shape {
          appearance Appearance {
    	material Material {
    	}
    	texture ImageTexture {
    	  url [ "someImage.jpg someImage.png" ]
    	}
          }
          geometry IndexedFaceSet {
    	creaseAngle 3.14159
    	color Color {
    	}
          }
        }
        Shape {
          geometry IndexedLineSet {
          }
        }
        Shape {
          geometry PointSet {
          }
        }
      ]
    }
    Background {
      skyColor [ 0.0 0.2 0.7 ]
    }
    CoordinateInterpolator {
    }
    DirectionalLight {
    }
    Group {
    }
    Inline {
    }
    NavigationInfo {
    }
    OrientationInterpolator {
    }
    DEF PI PositionInterpolator {
    }
    ScalarInterpolator {
    }
    DEF TS TimeSensor {
    }
    TouchSensor {
    }
    Transform {
    }
    Viewpoint {
    }
    WorldInfo {
    }
    ROUTE TS.fraction_changed TO PI.set_fraction
    
    


  8. ECMAScriptAnnexExample2 follows the second ECMAScript example in the VRML 97 specification. This is an OK example to exercise Script fields, but it doesn't actually do anything so a better example would be useful.

    Note how the actual scripting code in a Script node is now contained content, protected by CDATA tags, in order to prevent line feeds, & < and > from being normalized and breaking the script code. This approach is similar to that used by the XHTML specification, as described in 4.7 Whitespace handling in attribute values and 4.8 Script and Style elements.

    ECMAScriptAnnexExample2.xml, ECMAScriptAnnexExample2.html ECMAScriptAnnexExample2.wrl, ECMAScriptAnnexExample2.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='ECMAScriptAnnexExample2.xml'/> <meta name='Author' content='Don Brutzman'/> <meta name='Date' content='16 January 2000'/> <meta name='description' content='http://www.web3D.org/technicalinfo/specifications/vrml97/part1/javascript.html#Example'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ECMAScriptAnnexExample2.xml'/> <meta name='GENERATOR' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <WorldInfo info='Example 2, VRML 97 Annex C, ECMAScript Scripting Reference' title='ECMAScriptAnnexExample2.wrl'/> <WorldInfo info='http://www.web3D.org/technicalinfo/specifications/vrml97/part1/javascript.html#Example'/> <WorldInfo info='Edits: wrapped using a Transform node for completeness, renamed duplicate url field'/> <Transform DEF='ROOT_TRANSFORM'>
    <children>
    <Script DEF='Example_2'>
    <field USE='Example_2' name='myself' type='Node'/> <field USE='ROOT_TRANSFORM' name='root' type='Node'/> <field name='url2' type='Strings' value='foo.wrl'/> <field name='nodesLoaded' type='Node' vrml97Hint='eventIn'/> <field name='trigger_event' type='Boolean' vrml97Hint='eventIn'/> javascript: function trigger_event(value, ts){ // do something and then fetch values Browser.crolor="GREEN">content='13 April 2000'/> <meta name='description' content='ExampleExternProto-1.xml generated using X3D-Edit/Xeena'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ExampleExternProto-1'/> <meta name='GENERATOR' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <ExternProtoDeclare name='MyExternProtoName' url='http://www.web3D.org/TaskGroups/x3d/translation/examples/ExampleExternProto-1.wrl#MyExternProtoName'>
    <field name='field1' type='Boolean' vrml97Hint='eventIn'/> <field name='field2' type='Float' vrml97Hint='eventOut'/> <field name='field3' type='Integer' value='1' vrml97Hint='field'/> <field name='field4' type='String' value='ExampleExternProto' vrml97Hint='exposedField'/>
    </ExternProtoDeclare> <ProtoInstance name='MyExternProtoName'>
    <fieldValue fieldName='field3' value='3'/>
    </ProtoInstance>
    </Scene>
    </X3D> <-- Tag color codes: <NodeName attribute='value'/> -->
    ExampleExternProto-1.wrl
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: ExampleExternProto-1.xml
    # [meta] Author: Don Brutzman
    # [meta] Date: 13 April 2000
    # [meta] description: ExampleExternProto-1.xml generated using X3D-Edit/Xeena
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/ExampleExternProto-1
    # [meta] GENERATOR: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    EXTERNPROTO MyExternProtoName [
      eventIn SFBool field1
      eventOut SFFloat field2
      field SFInt32 field3 # XSL-translation warning:  no EXTERNPROTO initializations, ignoring initial value 1
      exposedField SFString field4 # XSL-translation warning:  no EXTERNPROTO initializations, ignoring initial value ExampleExternProto
    ][
      "http://www.web3D.org/TaskGroups/x3d/translation/examples/ExampleExternProto-1.wrl#MyExternProtoName"
    ]
    MyExternProtoName {
      field3 3
    }
    


  9. ExampleExternProto-2 shows how use of the nodeTypeHint attribute lets PROTO fields of arbitrary type (such as Node) properly translate back into VRML 97, by indicating what type of VRML node they correspond to.

    ExampleExternProto-2.xml, ExampleExternProto-2.html ExampleExternProto-2.wrl
    <X3D>
    
    <head>
    <meta name='FileName' content='ExampleExternProto-2.xml'/> <meta name='Author' content='Don Brutzman'/> <meta name='Date' content='13 January 2000'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ExampleExternProto-2.xml'/> <meta name='GENERATOR' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <ExternProtoDeclare name='MyNodeAppearance' nodeTypeHint='Appearance' url='http://www.web3D.org/somewhere/MyNodePROTOs.wrl#MyNodeAppearance'/> <ExternProtoDeclare name='MyNodeGeometry' nodeTypeHint='Box' url='http://www.web3D.org/somewhere/MyNodePROTOs.wrl#MyNodeGeometry'/> <Group>
    <children>
    <Shape DEF='A_SHAPE'>
    <appearance>
    <ProtoInstance name='MyNodeAppearance'/>
    </appearance> <geometry>
    <ProtoInstance name='MyNodeGeometry'/>
    </geometry>
    </Shape>
    </children>
    </Group>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    
    EXTERNPROTO MyNodeAppearance [
      # nodeTypeHint Appearance
    ][
      "http://www.web3D.org/somewhere/MyNodePROTOs.wrl#MyNodeAppearance"
    ]
    EXTERNPROTO MyNodeGeometry [
      # nodeTypeHint Box
    ][
      "http://www.web3D.org/somewhere/MyNodePROTOs.wrl#MyNodeGeometry"
    ]
    Group {
      bboxCenter 0 0 0
      bboxSize -1 -1 -1
      children [
        DEF A_SHAPE Shape {
          appearance MyNodeAppearance {
          }
          geometry MyNodeGeometry {
          }
        }
      ]
    }
    


  10. ExampleOrientationInterpolationSpinner demonstrates IS field matching. This example needs to be improved by including some renderable content which demonstrates that the IS connections are working.

    ExampleOrientationInterpolationSpinner.xml,
    ExampleOrientationInterpolationSpinner.html
    ExampleOrientationInterpolationSpinner.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='ExampleOrientationInterpolationSpinner.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='14 April 2000'/> <meta name='description' content='Look at isomorphism between OrientationInterpolator and a simple PROTO-ization'/> <meta name='url' content='http://www.web3d.org/TaskGroups/x3d/translation/examples/ExampleOrientationInterpolationSpinner.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <ProtoDeclare name='ExampleOrientationInterpolationSpinner'>
    <field IS='OI.key' name='key' type='Floats' value='0.0, 0.50, 1.0' vrml97Hint='exposedField' Next example. -->
  11. GeoVrmlExample1 is a simple example showing how to use the proposed GeoVrml protos in a scene.

    GeoVrmlExample1.xml, GeoVrmlExample1.html GeoVrmlExample1.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='GeoVrmlExample1.xml'/> <meta name='URL' content='http://www.web3d.org/TaskGroups/x3d/translation/examples/GeoVrmlExample1.xml'/> <meta name='description' content='GeoVrml 1.0 Example 1- GeoElevation'/> <meta name='reference' content='http://www.ai.sri.com/geovrml/1.0/doc'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='8 January 2000'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <ExternProtoDeclare name='GeoCoordinate' nodeTypeHint='Coordinate' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoCoordinate.wrl'>
    <field name='geoOrigin' type='Node'/> <field name='geoSystem' type='Strings'/> <field name='point' type='Strings'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoElevationGrid' nodeTypeHint='ElevationGrid' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoElevationGrid.wrl'>
    <field name='geoOrigin' type='Node'/> <field name='geoSystem' type='Strings'/> <field name='geoGridOrigin' type='String'/> <field name='xDimension' type='Integer'/> <field name='xSpacing' type='String'/> <field name='zDimension' type='Integer'/> <field name='zSpacing' type='String'/> <field name='yScale' type='Float'/> <field name='height' type='Floats'/> <field name='color' type='Node'/> <field name='texCoord' type='Node'/> <field name='normal' type='Node'/> <field name='normalPerVertex' type='Boolean'/> <field name='ccw' type='Boolean'/> <field name='colorPerVertex' type='Boolean'/> <field name='creaseAngle' type='Float'/> <field name='solid' type='Boolean'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoInline' nodeTypeHint='Inline' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoInline.wrl'>
    <field name='url' type='Strings'/> <field name='url_changed' type='Strings'/> <field name='load' type='Boolean'/> <field name='load_changed' type='Boolean'/> <field name='bboxCenter' type='Vector3'/> <field name='bboxSize' type='Vector3'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoLocation' nodeTypeHint='Transform' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoLocation.wrl'>
    <field name='geoOrigin' type='Node'/> <field name='geoSystem' type='Strings'/> <field name='geoCoords' type='String'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoLOD' nodeTypeHint='LOD' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoMetadata.wrl'>
    <field name='parentUrl' type='Strings'/> <field name='parentNode' type='Nodes'/> <field name='child1Url' type='Strings'/> <field name='child2Url' type='Strings'/> <field name='child3Url' type='Strings'/> <field name='child4Url' type='Strings'/> <field name='range' type='Float'/> <field name='geoOrigin' type='Node'/> <field name='geoSystem' type='Strings'/> <field name='center' type='String'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoMetadata' nodeTypeHint='WorldInfo' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoMetadata.wrl'>
    <field name='url' type='Strings'/> <field name='summary' type='Strings'/> <field name='data' type='Nodes'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoOrigin' nodeTypeHint='Group' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoOrigin.wrl'>
    <field name='geoSystem' type='Strings'/> <field name='geoCoords' type='String'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoPositionInterpolator' nodeTypeHint='PositionInterpolator' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoPositionInterpolator.wrl'>
    <field name='geoOrigin' type='Node'/> <field name='geoSystem' type='Strings'/> <field name='key' type='Floats'/> <field name='keyValue' type='Strings'/> <field name='set_fraction' type='Float'/> <field name='value_changed' type='Vector3'/> <field name='geovalue_changed' type='String'/>
    </ExternProtoDeclare> <ExternProtoDeclare name='GeoViewpoint' nodeTypeHint='Viewpoint' url='http://www.ai.sri.com/geovrml/1.0/protos/GeoViewpoint.wrl'>
    <field name='geoOrigin' type='Node'/> <field name='geoSystem' type='Strings'/> <field name='position' type='String'/> <field name='orientation' type='Rotation'/> <field name='fieldOfView' type='Float'/> <field name='jump' type='Boolean'/> <field name='navType' type='Strings'/> <field name='description' type='String'/> <field name='speed' type='Float'/> <field name='set_bind' type='Boolean'/> <field name='bindTime' type='Time'/> <field name='isBound' type='Boolean'/>
    </ExternProtoDeclare> <Group>
    <children>
    <Background groundColor='0 0 0' skyColor='0.1 0.1 0.8'/> <ProtoInstance name='GeoViewpoint'>
    <fieldValue fieldName='geoSystem' value='"GDC"'/> <fieldValue fieldName='position' value='"35.0 70.0 10000000"'/> <fieldValue fieldName='orientation' value='1 0 0 -1.57'/> <fieldValue fieldName='description' value='"Initial GeoViewpoint"'/>
    </ProtoInstance> <Shape>
    <appearance>
    <Appearance>
    <material>
    <Material diffuseColor='0.3 1.0 0.3'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <ProtoInstance name='GeoElevationGrid'>
    <fieldValue fieldName='geoSystem' value='"GDC"'/> <fieldValue fieldName='geoGridOrigin' value='-90 -180 0'/> <fieldValue fieldName='xDimension' value='21'/> <fieldValue fieldName='zDimension' value='11'/> <fieldValue fieldName='xSpacing' value='18'/> <fieldValue fieldName='zSpacing' value='18'/> <fieldValue fieldName='yScale' value='200'/> <fieldValue fieldName='height' value='0 0 0 0 0 0'/> <-- # extremely long array omitted here, see source... -->
    </ProtoInstance>
    </geometry>
    </Shape>
    </children>
    </Group>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: GeoVrmlExample1.xml
    # [meta] URL: http://www.web3d.org/TaskGroups/x3d/translation/examples/GeoVrmlExample1.xml
    # [meta] description: GeoVrml 1.0 Example 1- GeoElevation
    # [meta] reference: http://www.ai.sri.com/geovrml/1.0/doc
    # [meta] author: Don Brutzman
    # [meta] revised: 8 January 2000
    # [meta] generator: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    EXTERNPROTO GeoCoordinate [
      # nodeTypeHint Coordinate
      exposedField SFNode geoOrigin
      exposedField MFString geoSystem
      exposedField MFString point
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoCoordinate.wrl"
    ]
    EXTERNPROTO GeoElevationGrid [
      # nodeTypeHint ElevationGrid
      exposedField SFNode geoOrigin
      exposedField MFString geoSystem
      exposedField SFString geoGridOrigin
      exposedField SFInt32 xDimension
      exposedField SFString xSpacing
      exposedField SFInt32 zDimension
      exposedField SFString zSpacing
      exposedField SFFloat yScale
      exposedField MFFloat height
      exposedField SFNode color
      exposedField SFNode texCoord
      exposedField SFNode normal
      exposedField SFBool normalPerVertex
      exposedField SFBool ccw
      exposedField SFBool colorPerVertex
      exposedField SFFloat creaseAngle
      exposedField SFBool solid
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoElevationGrid.wrl"
    ]
    EXTERNPROTO GeoInline [
      # nodeTypeHint Inline
      exposedField MFString url
      exposedField MFString url_changed
      exposedField SFBool load
      exposedField SFBool load_changed
      exposedField SFVec3f bboxCenter
      exposedField SFVec3f bboxSize
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoInline.wrl"
    ]
    EXTERNPROTO GeoLocation [
      # nodeTypeHint Transform
      exposedField SFNode geoOrigin
      exposedField MFString geoSystem
      exposedField SFString geoCoords
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoLocation.wrl"
    ]
    EXTERNPROTO GeoLOD [
      # nodeTypeHint LOD
      exposedField MFString parentUrl
      exposedField MFNode parentNode
      exposedField MFString child1Url
      exposedField MFString child2Url
      exposedField MFString child3Url
      exposedField MFString child4Url
      exposedField SFFloat range
      exposedField SFNode geoOrigin
      exposedField MFString geoSystem
      exposedField SFString center
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoMetadata.wrl"
    ]
    EXTERNPROTO GeoMetadata [
      # nodeTypeHint WorldInfo
      exposedField MFString url
      exposedField MFString summary
      exposedField MFNode data
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoMetadata.wrl"
    ]
    EXTERNPROTO GeoOrigin [
      # nodeTypeHint Group
      exposedField MFString geoSystem
      exposedField SFString geoCoords
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoOrigin.wrl"
    ]
    EXTERNPROTO GeoPositionInterpolator [
      # nodeTypeHint PositionInterpolator
      exposedField SFNode geoOrigin
      exposedField MFString geoSystem
      exposedField MFFloat key
      exposedField MFString keyValue
      exposedField SFFloat set_fraction
      exposedField SFVec3f value_changed
      exposedField SFString geovalue_changed
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoPositionInterpolator.wrl"
    ]
    EXTERNPROTO GeoViewpoint [
      # nodeTypeHint Viewpoint
      exposedField SFNode geoOrigin
      exposedField MFString geoSystem
      exposedField SFString position
      exposedField SFRotation orientation
      exposedField SFFloat fieldOfView
      exposedField SFBool jump
      exposedField MFString navType
      exposedField SFString description
      exposedField SFFloat speed
      exposedField SFBool set_bind
      exposedField SFTime bindTime
      exposedField SFBool isBound
    ][
      "http://www.ai.sri.com/geovrml/1.0/protos/GeoViewpoint.wrl"
    ]
    Group {
      children [
        Background {
          groundColor [ 0 0 0 ]
          skyColor [ 0.1 0.1 0.8 ]
        }
        GeoViewpoint {
          geoSystem [ "GDC" ]
          position "35.0 70.0 10000000"
          orientation 1 0 0 -1.57
          description "Initial GeoViewpoint"
        }
        Shape {
          appearance Appearance {
    	material Material {
    	  diffuseColor 0.3 1.0 0.3
    	}
          }
          geometry GeoElevationGrid {
    	geoSystem [ "GDC" ]
    	geoGridOrigin "-90 -180 0"
    	xDimension 21
    	zDimension 11
    	xSpacing "18"
    	zSpacing "18"
    	yScale 200
    	height [ 0 0 0 0 0 0 ] # extremely long array omitted here, see source...
          }
        }
      ]
    }
    


  12. HelloWorld is the simple canonical language example for X3D and VRML.

    HelloWorld.xml, HelloWorld.html HelloWorld.wrl, HelloWorldTranslated.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='HelloWorld.xml'/> <meta name='description' content='Simple X3D example'/> <meta name='revised' content='31 January 2000'/> <meta name='author' content='Don Brutzman'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/HelloWorld.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Group>
    <children>
    <Viewpoint description='hello, world!' orientation='0.0 1.0 0.0 1.57' position='6.0 -1.0 0.0'/> <NavigationInfo type='"EXAMINE" "ANY"'/> <Shape>
    <geometry>
    <Sphere/>
    </geometry> <appearance>
    <Appearance>
    <texture>
    <ImageTexture url='"earth-topo.png" "earth-topo-small.gif" "http://www.web3D.org/TaskGroups/x3d/translation/earth-topo.png" "http://www.web3D.org/TaskGroups/x3d/translation/earth-topo-small.gif"'/>
    </texture>
    </Appearance>
    </appearance>
    </Shape> <Transform rotation='0.0 1.0 0.0 1.57' translation='0.0 -2.0 1.25'>
    <children>
    <Shape>
    <geometry>
    <Text string='"Hello" "world!"'/>
    </geometry> <appearance>
    <Appearance>
    <material>
    <Material diffuseColor='0.1 0.5 1.0'/>
    </material>
    </Appearance>
    </appearance>
    </Shape>
    </children>
    </Transform>
    </children>
    </Group>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: HelloWorld.xml
    # [meta] description: Simple X3D example
    # [meta] revised: 31 January 2000
    # [meta] author: Don Brutzman
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/HelloWorld.xml
    # [meta] generator: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    Group {
      children [
        Viewpoint {
          description "hello, world!"
          orientation 0.0 1.0 0.0 1.57
          position 6.0 -1.0 0.0
        }
        NavigationInfo {
          type [ "EXAMINE" "ANY" ]
        }
        Shape {
          geometry Sphere {
          }
          appearance Appearance {
    	texture ImageTexture {
    	  url [ "earth-topo.png"
    	  	"earth-topo-small.gif"
    	  	"http://www.web3D.org/TaskGroups/x3d/translation/earth-topo.png"
    	  	"http://www.web3D.org/TaskGroups/x3d/translation/earth-topo-small.gif" ]
    	}
          }
        }
        Transform {
          children [
    	Shape {
    	  geometry Text {
    	    string [ "Hello" "world!" ]
    	  }
    	  appearance Appearance {
    	    material Material {
    	      diffuseColor 0.1 0.5 1.0
    	    }
    	  }
    	}
          ]
          rotation 0.0 1.0 0.0 1.57
          translation 0.0 -2.0 1.25
        }
      ]
    }
    


  13. newScene is a simple starter scene for new X3D content.

    (Note that DTD-fragment prolog sections are not always presented by XML viewers, you may need to view the XML source.)

    newScene.xml, newScene.html newScene.wrl
    <?xml version="1.0" encoding="utf-8" ?>
    <!DOCTYPE X3D PUBLIC
    	"http://www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    	"file://localhost/C:/www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd" [
     <!ENTITY % Vrml97Profile  "INCLUDE">
     <!ENTITY % CoreProfile    "IGNORE">
     <!ENTITY % X3dExtensions  "IGNORE">
     <!ENTITY % GeoVrmlProfile "IGNORE">
    ]>
    
    <X3D>
    
    <head>
    <meta name='filename' content='*enter filename here*'/> <meta name='author' content='*enter name here*'/> <meta name='revised' content='*enter date here*'/> <meta name='description' content='*enter description here*'/> <meta name='url' content='*enter url address here*'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <-- Scene nodes are added here -->
    </Scene>
    </X3D> <-- Tag color codes: <NodeName attribute='value'/> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: *enter filename here*
    # [meta] author: *enter name here*
    # [meta] revised: *enter date here*
    # [meta] description: *enter description here*
    # [meta] url: *enter url address here*
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    # Scene nodes are added here
    


  14. Orbiter is a fun scene that exercises some MFFloat fields. Click and view the VRML version!

    Orbiter.xml, Orbiter.html Orbiter.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='Orbiter.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='9 January 2000'/> <meta name='description' content='A representative VRML/X3D scene graph fragment to demonstrate schema suitability for X3D'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/Orbiter.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <WorldInfo info='how well do schemas handle this simple world without data typing for arrays?' title='Orbiter.xml'/> <Viewpoint description='Hello, world' orientation='0 1 0 3.14159' position='0 0 -8'/> <NavigationInfo type='"EXAMINE" "ANY"'/> <Transform DEF='EarthCoordinateSystem'>
    <children>
    <Group DEF='MiniWorld'>
    <children>
    <Shape>
    <appearance>
    <Appearance>
    <texture>
    <ImageTexture url='"earth-topo.png" "earth-topo.gif" "http://www.web3d.org/TaskGroups/x3d/translation/earth-topo.png" "http://www.web3d.org/TaskGroups/x3d/translation/earth-topo.gif"'/>
    </texture>
    </Appearance>
    </appearance> <geometry>
    <Sphere/>
    </geometry>
    </Shape>
    </children>
    </Group> <Transform DEF='SimpleGeoStationarySatellite' rotation='1 0 0 .3' scale='0.1 0.3 0.1' translation='0 0 5'>
    <children>
    <Shape>
    <appearance>
    <Appearance>
    <material>
    <Material diffuseColor='0.9 0.1 0.1'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Box/>
    </geometry>
    </Shape>
    </children>
    </Transform>
    </children>
    </Transform> <TimeSensor DEF='OrbitalTimeInterval' cycleInterval='12.0' loop='true'/> <OrientationInterpolator DEF='SpinThoseThings' key='0.00 0.25 0.50 0.75 1.00' keyValue='0 1 0 0, 0 1 0 1.5708, 0 1 0 3.14159, 0 1 0 4.7123889, 0 1 0 6.2831852'/> <ROUTE fromField='fraction_changed' fromNode='OrbitalTimeInterval' toField='set_fraction' toNode='SpinThoseThings'/> <ROUTE fromField='value_changed' fromNode='SpinThoseThings' toField='rotation' toNode='EarthCoordinateSystem'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: Orbiter.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 9 January 2000
    # [meta] description: A representative VRML/X3D scene graph fragment to demonstrate schema suitability for X3D
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/Orbiter.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    WorldInfo {
      info [ "how well do schemas handle this simple world without data typing for arrays?" ]
      title "Orbiter.xml"
    }
    Viewpoint {
      description "Hello, world"
      orientation 0 1 0 3.14159
      position 0 0 -8
    }
    NavigationInfo {
      type [ "EXAMINE" "ANY" ]
    }
    DEF EarthCoordinateSystem Transform {
      children [
        DEF MiniWorld Group {
          children [
    	Shape {
    	  appearance Appearance {
    	    texture ImageTexture {
    	      url [ "earth-topo.png"
    	      	"earth-topo.gif"
    	      	"http://www.web3d.org/TaskGroups/x3d/translation/earth-topo.png"
    	      	"http://www.web3d.org/TaskGroups/x3d/translation/earth-topo.gif" ]
    	    }
    	  }
    	  geometry Sphere {
    	  }
    	}
          ]
        }
        DEF SimpleGeoStationarySatellite Transform {
          rotation 1 0 0 .3
          scale 0.1 0.3 0.1
          translation 0 0 5
          children [
    	Shape {
    	  appearance Appearance {
    	    material Material {
    	      diffuseColor 0.9 0.1 0.1
    	    }
    	  }
    	  geometry Box {
    	  }
    	}
          ]
        }
      ]
    }
    DEF OrbitalTimeInterval TimeSensor {
      cycleInterval 12.0
      loop TRUE
    }
    DEF SpinThoseThings OrientationInterpolator {
      key [ 0.00 0.25 0.50 0.75 1.00 ]
      keyValue [ 0 1 0 0, 0 1 0 1.5708, 0 1 0 3.14159, 0 1 0 4.7123889, 0 1 0 6.2831852 ]
    }
    ROUTE OrbitalTimeInterval.fraction_changed TO SpinThoseThings.set_fraction
    ROUTE SpinThoseThings.value_changed TO EarthCoordinateSystem.rotation
    
    


  15. ProtoInstanceExample exercises IS functionality for fields of simple types as well as node types.

    ProtoInstanceExample.xml,
    ProtoInstanceExample.html
    ProtoInstanceExample.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='ProtoInstanceExample.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='22 January 2000'/> <meta name='description' content='Simple PROTO example, includes Node as a field for PROTO'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ProtoInstanceExample.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <ProtoDeclare name='NewShape'>
    <field IS='ContainedCylinder.height' name='newHeight' type='Float' value='1' vrml97Hint='field'/> <field IS='SomethingElseTest.radius ContainedCylinder.radius' name='newRadius' type='Float' value='2' vrml97Hint='field'/> <field IS='ContainedShape.appearance' name='InitialAppearance' type='Node' vrml97Hint='field'>
    <Appearance>
    <material>
    <Material diffuseColor='1 0 0'/>
    </material>
    </Appearance>
    </field> <Shape DEF='ContainedShape'>
    <geometry>
    <Cylinder DEF='ContainedCylinder'/>
    </geometry>
    </Shape>
    </ProtoDeclare> <NavigationInfo type='"EXAMINE" "ANY"'/> <Billboard>
    <children>
    <ProtoInstance name='NewShape'>
    <fieldValue fieldName='newHeight' value='3'/> <fieldValue fieldName='newRadius' value='4'/> <fieldValue fieldName='InitialAppearance'>
    <Appearance>
    <material>
    <Material DEF='CylinderMaterial' diffuseColor='0 1 0'/>
    </material>
    </Appearance>
    </fieldValue>
    </ProtoInstance>
    </children>
    </Billboard>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: ProtoInstanceExample.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 22 January 2000
    # [meta] description: Simple PROTO example, includes Node as a field for PROTO
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/ProtoInstanceExample.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    PROTO NewShape [
      field SFFloat newHeight 1
      field SFFloat newRadius 2
      field SFNode InitialAppearance Appearance {
        material Material {
          diffuseColor 1 0 0
        }
      }
      
    ] {
      DEF ContainedShape Shape {
        appearance IS InitialAppearance
        geometry DEF ContainedCylinder Cylinder {
          height IS newHeight
          radius IS newRadius
        }
      }
    }
    NavigationInfo {
      type [ "EXAMINE" "ANY" ]
    }
    Billboard {
      children [
        NewShape {
          newHeight 3
          newRadius 4
          InitialAppearance Appearance {
    	material DEF CylinderMaterial Material {
    	  diffuseColor 0 1 0
    	}
          }
        }
      ]
    }
    


  16. ProtoTagDtdDeclarationExamples provides PROTO tag-definition examples to demonstrate DTD modularization and extensibility in X3D scenes.

    (Note that DTD-fragment prolog sections are not always presented by XML viewers, you may need to view the XML source.)

    ProtoTagDtdDeclarationExamples.xml,
    ProtoTagDtdDeclarationExamples.html
    ProtoTagDtdDeclarationExamples.wrl
    
    <?xml version="1.0" encoding="utf-8" ?>
    
    <!-- Filename:     ProtoTagDtdDeclarationExamples.xml
         Revised:      17 April 2000
         Author:       Don Brutzman
         Description:  a complete set of PROTO examples demonstrating how to
         extend the X3D DTD to accept and validate new nodes, in six steps.
    
         X3D authors are encouraged to use this file as a template for defining
         their own tags corresponding to PROTOs.  Precise accuracy is essential
         or you'll clobber the entire scene by failing XML validation checks.
         XML Document Type Definitions (DTDs) are gnarly, be careful out there! :)
    
         Please note there is a very simple alternative to using customized tags:
         ignore all of these steps and just use ProtoInstance tags.  The benefit
         of defining new nodes is gaining strong validation of tags and fields at
         authoring time.  You can still get similar error checking by just using
         ProtoInstance, but it must be performed by a browser at run time.
    
         If your browser hides Steps 2-4, use View Source to find them again.  -->
    
    
    <!-- ********************************************************************* -->
    <!-- ** Step 1: Copy the following DOCTYPE statement in your X3D scene. ** -->
    <!-- **         Ensure you include the square backet [ on line 32!      ** -->
    <!-- **         Modify INCLUDE/IGNORE to match profiles of interest.    ** -->
    <!-- ********************************************************************* -->
    
    
    <!DOCTYPE X3D PUBLIC
    	"http://www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    	"file://localhost/C:/www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    [
     <!ENTITY % Vrml97Profile  "INCLUDE">
     <!ENTITY % CoreProfile    "IGNORE">
     <!ENTITY % X3dExtensions  "IGNORE">
     <!ENTITY % GeoVrmlProfile "IGNORE">
    
    
    <!-- ********************************************************************* -->
    <!-- ** Step 2: Copy extension declarations for your nodes of interest. ** -->
    <!-- **         Edit the |-separated PROTO names to match your content. ** -->
    <!-- ********************************************************************* -->
    
    
    <!ENTITY % AppearanceNodeExtensions        "NewAppearanceExample|">
    <!ENTITY % AudioClipNodeExtensions         "NewAudioClipExample|">
    <!ENTITY % BindableNodeExtensions          "NewBackgroundExample|NewFogExample|NewNavigationInfoExample|NewViewpointExample|">
    <!ENTITY % ColorNodeExtensions             "NewColorExample|">
    <!ENTITY % CoordinateNodeExtensions        "NewCoordinateExample|">
    <!ENTITY % FontStyleNodeExtensions         "NewFontStyleExample|">
    <!ENTITY % GeometryNodeExtensions          "NewBoxExample|NewConeExample|NewCylinderExample|NewElevationGridExample|NewExtrusionExample|NewIndexedFaceSetExample|NewIndexedLineSetExample|NewPointSetExample|NewSphereExample|NewTextExample|">
    <!ENTITY % GroupingNodeExtensions          "NewAnchorExample|NewBillboardExample|NewCollisionExample|NewGroupExample|NewInlineExample|NewLODExample|NewSwitchExample|NewTransformExample|">
    <!ENTITY % InterpolatorNodeExtensions      "NewColorInterpolatorExample|NewCoordinateInterpolatorExample|NewNormalInterpolatorExample|NewOrientationInterpolatorExample|NewPositionInterpolatorExample|NewScalarInterpolatorExample|"> 
    <!ENTITY % LightNodeExtensions             "NewDirectionalLightExample|NewPointLightExample|NewSpotLightExample|">
    <!ENTITY % MaterialNodeExtensions          "NewMaterialExample|">
    <!ENTITY % NormalNodeExtensions            "NewNormalExample|">
    <!ENTITY % ScriptNodeExtensions            "NewScriptExample|"> 
    <!ENTITY % SensorNodeExtensions            "NewCylinderSensorExample|NewPlaneSensorExample|NewProximitySensorExample|NewSphereSensorExample|NewTimeSensorExample|NewTouchSensorExample|NewVisibilitySensorExample|">
    <!ENTITY % ShapeNodeExtensions             "NewShapeExample|">
    <!ENTITY % SoundNodeExtensions             "NewSoundExample|">
    
    <!-- MovieTexture must appear twice: -->
    <!ENTITY % MovieTextureNodeExtensions      "NewMovieTextureExample|">
    <!ENTITY % TextureNodeExtensions           "NewImageTextureExample|NewMovieTextureExample|NewPixelTextureExample|">
    
    <!ENTITY % TextureCoordinateNodeExtensions "NewTextureCoordinateExample|">
    <!ENTITY % TextureTransformNodeExtensions  "NewTextureTransformExample|">
    <!ENTITY % WorldInfoNodeExtensions         "NewWorldInfoExample|">
    
    
    <!-- ********************************************************************* -->
    <!-- *** Step 3: Copy entity declarations for your nodes of interest.  *** -->
    <!-- ***         If any of your protos are eligible content, add them. *** -->
    <!-- ***         Substitute ANY for child nodes to avoid validation.   *** -->
    <!-- ********************************************************************* -->
    
    
    <!ELEMENT NewAnchorExample ( (fieldValue)*, (children)? ) >
    <!ATTLIST NewAnchorExample
        description  CDATA #IMPLIED
        parameter    CDATA #IMPLIED
        url          CDATA #IMPLIED
        bboxCenter   CDATA "0 0 0"
        bboxSize     CDATA "-1 -1 -1"
        nodeTypeHint CDATA  #FIXED "Anchor"
        DEF          ID       #IMPLIED
        USE          IDREF    #IMPLIED>
    
    <!ELEMENT NewAppearanceExample ( (fieldValue)*,
      ( (material, ((texture, textureTransform?) | (textureTransform, texture?))? ) |
    	(texture, ((material, textureTransform?) | (textureTransform, material?))? ) |
    	(textureTransform, ((texture, material?) | (material, texture?))? ) )?
    ) >
    <!ATTLIST NewAppearanceExample
        nodeTypeHint CDATA  #FIXED "Appearance"
        DEF          ID       #IMPLIED
        USE          IDREF    #IMPLIED>
    
    <!--- NewAudioClipExample through NewTransformExample omitted, View Source to see them... -->
    
    <!ELEMENT NewViewpointExample (fieldValue)* >
    <!ATTLIST NewViewpointExample
        fieldOfView CDATA "0.785398"
        jump (true|false) "true"
        orientation CDATA "0 0 1 0"
        position CDATA "0 0 10"
        description CDATA #IMPLIED
        bind (true|false) "false"
        bindTime CDATA "-1"
        isBound (true|false) "false"
        examine CDATA "0 0 0"
        nodeTypeHint CDATA  #FIXED "Viewpoint"
        DEF          ID       #IMPLIED
        USE          IDREF    #IMPLIED>
    <!-- examine (point of rotation) is proposed addition, maybe belongs in NavigationInfo instead... -->
    
    <!ELEMENT NewVisibilitySensorExample (fieldValue)* >
    <!ATTLIST NewVisibilitySensorExample
        center CDATA "0 0 0"
        enabled (true|false) "true"
        size CDATA "0 0 0"
        enterTime CDATA "0.0"
        exitTime CDATA "0.0"
        isActive (true|false) "false"
        nodeTypeHint CDATA  #FIXED "VisibilitySensor"
        DEF          ID       #IMPLIED
        USE          IDREF    #IMPLIED>
    
    <!ELEMENT NewWorldInfoExample (fieldValue)* >
    <!ATTLIST NewWorldInfoExample
        info CDATA #IMPLIED
        title CDATA #IMPLIED
        nodeTypeHint CDATA  #FIXED "WorldInfo"
        DEF          ID       #IMPLIED
        USE          IDREF    #IMPLIED>
    
    
    <!-- ********************************************************************* -->
    <!-- *** Step 4: Copy  ] >  terminator to close the internal subset.   *** -->
    <!-- ***         Also copy X3D, Header and Scene tag pairs if needed.  *** -->
    <!-- ********************************************************************* -->
    
    ]>
    
    
    
    <X3D>
    
    <head>
    <meta name='filename' content='ProtoTagDtdDeclarationExamples.xml'/> <meta name='revised' content='17 April 2000'/> <meta name='author' content='Don Brutzman'/> <meta name='e-mail' content='mailto:brutzman@nps.navy.mil'/> <meta name='description' content='Provide PROTO tag-definition examples to demonstrate DTD modularization and extensibility in X3D scenes. Prepared using IBM's xmlviewer application, which shows fully substituted DTD results. A single-node example is also available in the SpinGroupExternalDeclaration.xml scene.'/> <meta name='url' content='http://www.web3d.org/TaskGroups/x3d/translation/examples/ProtoTagExamples.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <-- ********************************************************************* --> <-- *** Step 5: Copy/edit ProtoDeclare, (optionally ProtoInstance) *** --> <-- *** and the tagset version for your nodes of interest. *** --> <-- *** When instantiating field Node/Nodes or field values, *** --> <-- *** use fieldValue tags to override the initial values. *** --> <-- *** The following example content instantiates prototype *** --> <-- *** NewTransformExample using tags and ProtoInstance. *** --> <-- ********************************************************************* --> <-- Declaring the NewTransformExample PROTO: --> <ProtoDeclare name='NewTransformExample'>
    <field name='translation' type='Vector3' value='0 0 0' IS='InitialTransform.translation' vrml97Hint='exposedField'/> <field name='rotation' type='Rotation' value='0 0 1 0' IS='InitialTransform.rotation' vrml97Hint='exposedField'/> <field name='center' type='Vector3' value='0 0 0' vrml97Hint='exposedField'/> <field name='scale' type='Vector3' value='1 1 1' vrml97Hint='exposedField'/> <field name='scaleOrientation' type='Rotation' value='0 0 1 0' vrml97Hint='exposedField'/> <field name='bboxCenter' type='Vector3' value='0 0 0' vrml97Hint='field'/> <field name='bboxSize' type='Vector3' value='-1 -1 -1' vrml97Hint='field'/> <field name='children' type='Nodes' vrml97Hint='exposedField'/> <-- Transform is first node, which determines node type, and encloses children for instances. --> <Transform DEF='InitialTransform'/>
    </ProtoDeclare> <-- Instantiating the NewTransformExample PROTO using a ProtoInstance tag: --> <ProtoInstance name='NewTransformExample'>
    <fieldValue value='-5 0 0' fieldName='translation'/> <fieldValue fieldName='children'>
    <Shape>
    <appearance>
    <Appearance DEF='AQUAMARINE'>
    <material>
    <Material diffuseColor='0.1 0.8 0.8'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Text string='SpinGroup'/>
    </geometry>
    </Shape>
    </fieldValue>
    </ProtoInstance> <-- Instantiating the NewTransformExample PROTO using a customized tag: --> <NewTransformExample translation='5 0 0' scale='1 1 1' scaleOrientation='0 0 1 0' center='0 0 0' nodeTypeHint='Transform' rotation='0 0 1 0'>
    <fieldValue fieldName='children'>
    <Shape>
    <appearance>
    <Appearance USE='AQUAMARINE'/>
    </appearance> <geometry>
    <Text string='Example'/>
    </geometry>
    </Shape>
    </fieldValue>
    </NewTransformExample>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: ProtoTagDtdDeclarationExamples.xml
    # [meta] revised: 17 April 2000
    # [meta] author: Don Brutzman
    # [meta] e-mail: mailto:brutzman@nps.navy.mil
    # [meta] description: Provide PROTO tag-definition examples to demonstrate DTD modularization and extensibility in X3D scenes. Prepared using IBM's xmlviewer application, which shows fully substituted DTD results. A single-node example is also available in the SpinGroupExternalDeclaration.xml scene.
    # [meta] url: http://www.web3d.org/TaskGroups/x3d/translation/examples/ProtoTagExamples.xml
    # [meta] generator: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    # *********************************************************************
    # *** Step 5: Copy/edit ProtoDeclare, (optionally ProtoInstance) ***
    # *** and the tagset version for your nodes of interest. ***
    # *** When instantiating field Node/Nodes or field values, ***
    # *** use fieldValue tags to override the initial values. ***
    # *** The following example content instantiates prototype ***
    # *** NewTransformExample using tags and ProtoInstance. ***
    # *********************************************************************
    # Declaring the NewTransformExample PROTO:
    PROTO NewTransformExample [
      exposedField SFVec3f translation 0 0 0
      exposedField SFRotation rotation 0 0 1 0
      exposedField SFVec3f center 0 0 0
      exposedField SFVec3f scale 1 1 1
      exposedField SFRotation scaleOrientation 0 0 1 0
      field SFVec3f bboxCenter 0 0 0
      field SFVec3f bboxSize -1 -1 -1
      exposedField MFNode children [ ]
      # Transform is first node, which determines node type, and encloses children for instances.
    ] {
      # Transform is first node, which determines node type, and encloses children for instances.
      DEF InitialTransform Transform {
        translation IS translation
        rotation IS rotation
      }
    }
    # Instantiating the NewTransformExample PROTO using a ProtoInstance tag:
    NewTransformExample {
      translation -5 0 0
      children Shape {
        appearance DEF AQUAMARINE Appearance {
          material Material {
    	diffuseColor 0.1 0.8 0.8
          }
        }
        geometry Text {
          string [ "SpinGroup" ]
        }
      }
    }
    # Instantiating the NewTransformExample PROTO using a customized tag:
    NewTransformExample {
      translation 5 0 0
      scale 1 1 1
      scaleOrientation 0 0 1 0
      center 0 0 0
      rotation 0 0 1 0
      children Shape {
        appearance USE AQUAMARINE
        geometry Text {
          string [ "Example" ]
        }
      }
      children [
      ]
    }
    


  17. ProxyShapeExample, when unwrapped, shows that disambiguation of multiple child nodes is completely possible even when node children of mixed type and mixed order are present. Note the order Shape-Proxy-Shape in the unwrapped X3d version is correctly translated to Proxy-children[Shape-Shape] in the VRML version.

    ProxyShapeExample.xml, ProxyShapeExample.html, ProxyShapeExampleUnwrapped.xml ProxyShapeExample.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='ProxyShapeExample.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='14 January 2000'/> <meta name='description' content='Collision node child test case: Shape Proxy Shape'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ProxyShapeExample.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Collision DEF='MyCollision' collideTime='0.0'>
    <proxy>
    <Shape>
    <geometry>
    <Box/>
    </geometry>
    </Shape>
    </proxy> <children>
    <Shape>
    <geometry>
    <Sphere/>
    </geometry>
    </Shape> <Shape>
    <geometry>
    <Cone/>
    </geometry>
    </Shape>
    </children>
    </Collision> <Script DEF='MyNodeProducer'>
    <field name='outputNode' type='Nodes' vrml97Hint='eventOut'/>
    </Script> <ROUTE fromField='outputNode' fromNode='MyNodeProducer' toField='children' toNode='MyCollision'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: ProxyShapeExample.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 14 January 2000
    # [meta] description: Collision node child test case: Shape Proxy Shape
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/ProxyShapeExample.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    DEF MyCollision Collision {
      collideTime 0.0
      children [
        Shape {
          geometry Sphere {
          }
        }
        Shape {
          geometry Cone {
          }
        }
      ]
      proxy Shape {
        geometry Box {
        }
      }
    }
    DEF MyNodeProducer Script {
      eventOut MFNode outputNode
      url ""
    }
    ROUTE MyNodeProducer.outputNode TO MyCollision.children
    
    


  18. QuadTreesExample also shows that disambiguation of multiple child nodes is completely possible even when node children of mixed type and mixed order are present. Two independent solution approaches (refer by DEF and contain Node) are presented in pairs, using PROTOs or native XML tags declared in the prolog section of the X3D file.

    This is a good example to see two general ways of extending the VRML 97 scene graph: using either ProtoDeclare declarations, or native-XML tag declarations in the DTD-fragment prolog section of an X3D scene file. Further explanation about the scene code appears in the original QuadTreeExamplesExplanation.html; also be sure to check the QuadTreeExamples.wrl results.

    The techniques in this example also demonstrate conclusively that field wrapper tags are not necessary for unambiguous scene graph representations. See WrapperTagsExample for further detail on that topic.

    (Note that DTD-fragment prolog sections are not always presented by XML viewers, you may need to view the XML source.)

    QuadTreeExamples.xml, QuadTreeExamples.html QuadTreeExamples.wrl
    <?xml version="1.0" encoding="utf-8" ?>
    <!DOCTYPE X3D PUBLIC
    	"http://www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    	"file://localhost/C:/www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    [
     <!ENTITY % Vrml97Profile  "INCLUDE">
     <!ENTITY % CoreProfile    "IGNORE">
     <!ENTITY % X3dExtensions  "IGNORE">
     <!ENTITY % GeoVrmlProfile "IGNORE">
    
    <!-- this pattern was copied, pasted and adapted from ProtoTagDtdDeclarationExamples.xml
         which provides templates for native tag definition for any node type.  -->
    
    
    <!ENTITY % GroupingNodeExtensions          "QuadTree-USEchildren|QuadTree-TagChildren|">
    
    
    <!-- example solution definition #2 -->
    
    <!ELEMENT QuadTree-USEchildren (fieldValue*, children?) >
    <!ATTLIST QuadTree-USEchildren
    	upperLeftName    IDREF #IMPLIED
    	upperRightName   IDREF #IMPLIED
    	lowerLeftName    IDREF #IMPLIED
    	lowerRightName   IDREF #IMPLIED
    	nodeTypeHint     CDATA  #FIXED "Group"
    	DEF              ID    #IMPLIED
    	USE              IDREF #IMPLIED>
    
    
    <!-- example solution definition #4 -->
    
    <!ELEMENT QuadTree-TagChildren (fieldValue*, children?) >
    <!ATTLIST QuadTree-TagChildren
    	upperLeftNode    IDREF #IMPLIED
    	upperRightNode   IDREF #IMPLIED
    	lowerLeftNode    IDREF #IMPLIED
    	lowerRightNode   IDREF #IMPLIED
    	nodeTypeHint     CDATA #FIXED "Group"
    	DEF              ID    #IMPLIED
    	USE              IDREF #IMPLIED>
    ]>
    
    <X3D>
    
    <head>
    <meta name='filename' content='QuadTreeExamples.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='20 April 2000'/> <meta name='description' content='Show four ways of solving the QuadTree problem using native XML tags, PROTOs, IDREF/USE and MFNode children compatibly using x3d-draft.dtd with VRML 97. Other solutions may also be possible.'/> <meta name='translation' content='../X3dToVrml97.xsl'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/QuadTreeExamples.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <-- Example solution approach #1 --> <-- Note that PROTO declarations are also provided for compatible backwards translation to VRML 97 encoding. They are not necessary for independent X3D use of the QuadTree examples. --> <ProtoDeclare name='QuadTree-USEchildren'>
    <field type='Nodes' name='upperLeftDEFName' IS='GroupA.children'/> <field type='Nodes' name='upperRightDEFName' IS='GroupB.children'/> <field type='Nodes' name='lowerLeftDEFName' IS='GroupC.children'/> <field type='Nodes' name='lowerRightDEFName' IS='GroupD.children'/> <-- children field must be declared for any PROTOs or native-tag nodes with children --> <field type='Nodes' name='children'/> <-- VRML 97 specification paragraph 4.8.3, PROTO definition semantics: "A prototype definition consists of one or more nodes." PROTO body follows. --> <Group>
    <children>
    <Group DEF='GroupA'/> <Group DEF='GroupB'/> <Group DEF='GroupC'/> <Group DEF='GroupD'/>
    </children>
    </Group>
    </ProtoDeclare> <-- Example solution approach #3 --> <ProtoDeclare name='QuadTree-TagChildren'>
    <field type='Nodes' name='upperLeftNode' IS='GroupE.children'/> <field type='Nodes' name='upperRightNode' IS='GroupF.children'/> <field type='Nodes' name='lowerLeftNode' IS='GroupG.children'/> <field type='Nodes' name='lowerRightNode' IS='GroupH.children'/> <field type='Nodes' name='children'/> <-- PROTO body follows. --> <Group>
    <children>
    <Group DEF='GroupE'/> <Group DEF='GroupF'/> <Group DEF='GroupG'/> <Group DEF='GroupH'/>
    </children>
    </Group>
    </ProtoDeclare> <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Group>
    <children>
    <Viewpoint description='View QuadTree examples' position='0 0 30'/> <NavigationInfo type='"EXAMINE" "ANY"'/> <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <-- Examples 1 and 2 use DEF names for subtree references, via PROTOs or XML tags. --> <Transform DEF='Example_1' translation='0 6 0'>
    <children>
    <-- ProtoInstance nodeType Group --> <ProtoInstance name='QuadTree-USEchildren'>
    <fieldValue fieldName='upperLeftDEFName' value='UPPER_LEFT'/> <fieldValue fieldName='upperRightDEFName' value='UPPER_RIGHT'/> <fieldValue fieldName='lowerLeftDEFName' value='LOWER_LEFT'/> <fieldValue fieldName='lowerRightDEFName' value='LOWER_RIGHT'/> <children>
    <Group>
    <children>
    <Transform DEF='UPPER_LEFT' translation='4 0 4'>
    <children>
    <Shape>
    <appearance>
    <Appearance DEF='RED'>
    <material>
    <Material diffuseColor='1 0 0'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Box/>
    </geometry>
    </Shape>
    </children>
    </Transform> <Transform DEF='UPPER_RIGHT' translation='3 0 -3'>
    <children>
    <Shape>
    <appearance>
    <Appearance DEF='GREEN'>
    <material>
    <Material diffuseColor='0 1 0'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Sphere/>
    </geometry>
    </Shape>
    </children>
    </Transform> <Transform DEF='LOWER_LEFT' translation='-3 0 -3'>
    <children>
    <Shape>
    <appearance>
    <Appearance DEF='BLUE'>
    <material>
    <Material diffuseColor='.2 .2 1'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Cylinder/>
    </geometry>
    </Shape>
    </children>
    </Transform> <Transform DEF='LOWER_RIGHT' translation='-6 0 4'>
    <children>
    <Shape>
    <appearance>
    <Appearance DEF='WHITE'>
    <material>
    <Material diffuseColor='1 1 1'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Text string=' "QuadTree-USEchildren" "ProtoInstance" '/>
    </geometry>
    </Shape>
    </children>
    </Transform>
    </children>
    </Group>
    </children>
    </ProtoInstance>
    </children>
    </Transform> <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Transform DEF='Example_2' translation='0 2 0'>
    <children>
    <QuadTree-USEchildren nodeTypeHint='Group'>
    <fieldValue fieldName='upperLeftDEFName' value='UPPER_LEFT'/> <fieldValue fieldName='upperRightDEFName' value='UPPER_RIGHT'/> <fieldValue fieldName='lowerLeftDEFName' value='LOWER_LEFT'/> <fieldValue fieldName='lowerRightDEFName' value='LOWER_RIGHT_EXAMPLE_2'/> <children>
    <-- children which follow are locally convenient and referenced via IDREF/USE --> <Transform DEF='LOWER_RIGHT_EXAMPLE_2' translation='-6 0 4'>
    <children>
    <Shape>
    <geometry>
    <Text string=' "QuadTree-USEchildren" "Native tags" '/>
    </geometry> <appearance>
    <Appearance USE='WHITE'/>
    </appearance>
    </Shape>
    </children>
    </Transform>
    </children>
    </QuadTree-USEchildren>
    </children>
    </Transform> <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <-- Examples 3 and 4 use actual nodes for subtree references, via PROTOs or XML tags. --> <Transform DEF='Example_3' translation='0 -2 0'>
    <children>
    <-- ProtoInstance nodeType Group --> <ProtoInstance name='QuadTree-TagChildren'>
    <fieldValue fieldName='upperLeftNode'>
    <Transform USE='UPPER_LEFT'/>
    </fieldValue> <fieldValue fieldName='upperRightNode'>
    <Transform USE='UPPER_RIGHT'/>
    </fieldValue> <fieldValue fieldName='lowerLeftNode'>
    <Transform USE='LOWER_LEFT'/>
    </fieldValue> <fieldValue fieldName='lowerRightNode'>
    <Transform translation='-6 0 4'>
    <children>
    <Shape>
    <geometry>
    <Text string=' "QuadTree-TagChildren" "ProtoInstance" '/>
    </geometry> <appearance>
    <Appearance USE='WHITE'/>
    </appearance>
    </Shape>
    </children>
    </Transform>
    </fieldValue>
    </ProtoInstance>
    </children>
    </Transform> <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Transform DEF='Example_4' translation='0 -6 0'>
    <children>
    <QuadTree-TagChildren nodeTypeHint='Group'>
    <fieldValue fieldName='upperLeftNode'>
    <Transform USE='UPPER_LEFT'/>
    </fieldValue> <fieldValue fieldName='upperRightNode'>
    <Transform USE='UPPER_RIGHT'/>
    </fieldValue> <fieldValue fieldName='lowerLeftNode'>
    <Transform USE='LOWER_LEFT'/>
    </fieldValue> <fieldValue fieldName='lowerRightNode'>
    <Transform translation='-6 0 4'>
    <children>
    <Shape>
    <geometry>
    <Text string=' "QuadTree-TagChildren" "Native tags" '/>
    </geometry> <appearance>
    <Appearance USE='WHITE'/>
    </appearance>
    </Shape>
    </children>
    </Transform> <WorldInfo info='this WorldInfo is here to demonstrate that the example is type MFNode/Nodes'/>
    </fieldValue>
    </QuadTree-TagChildren>
    </children>
    </Transform>
    </children>
    </Group> <-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: QuadTreeExamples.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 20 April 2000
    # [meta] description: Show four ways of solving the QuadTree problem using native XML tags, PROTOs, IDREF/USE and MFNode children compatibly using x3d-draft.dtd with VRML 97. Other solutions may also be possible.
    # [meta] translation: ../X3dToVrml97.xsl
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/QuadTreeExamples.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # Example solution approach #1
    # Note that PROTO declarations are also provided for compatible backwards translation to VRML 97 encoding. They are not necessary for independent X3D use of the QuadTree examples.
    PROTO QuadTree-USEchildren [
      exposedField MFNode upperLeftDEFName [ ]
      exposedField MFNode upperRightDEFName [ ]
      exposedField MFNode lowerLeftDEFName [ ]
      exposedField MFNode lowerRightDEFName [ ]
      # children field must be declared for any PROTOs or native-tag nodes with children
      exposedField MFNode children [ ]
      # VRML 97 specification paragraph 4.8.3, PROTO definition semantics: "A prototype definition consists of one or more nodes." PROTO body follows.
    ] {
      # children field must be declared for any PROTOs or native-tag nodes with children
      # VRML 97 specification paragraph 4.8.3, PROTO definition semantics: "A prototype definition consists of one or more nodes." PROTO body follows.
      Group {
        children [
          DEF GroupA Group {
    	children IS upperLeftDEFName
          }
          DEF GroupB Group {
    	children IS upperRightDEFName
          }
          DEF GroupC Group {
    	children IS lowerLeftDEFName
          }
          DEF GroupD Group {
    	children IS lowerRightDEFName
          }
        ]
      }
    }
    # Example solution approach #3
    PROTO QuadTree-TagChildren [
      exposedField MFNode upperLeftNode [ ]
      exposedField MFNode upperRightNode [ ]
      exposedField MFNode lowerLeftNode [ ]
      exposedField MFNode lowerRightNode [ ]
      exposedField MFNode children [ ]
      # PROTO body follows.
    ] {
      # PROTO body follows.
      Group {
        children [
          DEF GroupE Group {
    	children IS upperLeftNode
          }
          DEF GroupF Group {
    	children IS upperRightNode
          }
          DEF GroupG Group {
    	children IS lowerLeftNode
          }
          DEF GroupH Group {
    	children IS lowerRightNode
          }
        ]
      }
    }
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Group {
      children [
        Viewpoint {
          description "View QuadTree examples"
          position 0 0 30
        }
        NavigationInfo {
          type [ "EXAMINE" "ANY" ]
        }
        DEF Example_1 Transform {
          translation 0 6 0
          children [
    	QuadTree-USEchildren {
    	  children [
    	    Group {
    	      children [
    		DEF UPPER_LEFT Transform {
    		  translation 4 0 4
    		  children [
    		    Shape {
    		      appearance DEF RED Appearance {
    			material Material {
    			  diffuseColor 1 0 0
    			}
    		      }
    		      geometry Box {
    		      }
    		    }
    		  ]
    		}
    		DEF UPPER_RIGHT Transform {
    		  translation 3 0 -3
    		  children [
    		    Shape {
    		      appearance DEF GREEN Appearance {
    			material Material {
    			  diffuseColor 0 1 0
    			}
    		      }
    		      geometry Sphere {
    		      }
    		    }
    		  ]
    		}
    		DEF LOWER_LEFT Transform {
    		  translation -3 0 -3
    		  children [
    		    Shape {
    		      appearance DEF BLUE Appearance {
    			material Material {
    			  diffuseColor .2 .2 1
    			}
    		      }
    		      geometry Cylinder {
    		      }
    		    }
    		  ]
    		}
    		DEF LOWER_RIGHT Transform {
    		  translation -6 0 4
    		  children [
    		    Shape {
    		      appearance DEF WHITE Appearance {
    			material Material {
    			  diffuseColor 1 1 1
    			}
    		      }
    		      geometry Text {
    			string [ "QuadTree-USEchildren" "ProtoInstance" ]
    		      }
    		    }
    		  ]
    		}
    	      ]
    	    }
    	  ]
    	  upperLeftDEFName USE UPPER_LEFT
    	  upperRightDEFName USE UPPER_RIGHT
    	  lowerLeftDEFName USE LOWER_LEFT
    	  lowerRightDEFName USE LOWER_RIGHT
    	}
          ]
        }
        DEF Example_2 Transform {
          translation 0 2 0
          children [
    	QuadTree-USEchildren {
    	  children [
    	    DEF LOWER_RIGHT_EXAMPLE_2 Transform {
    	      translation -6 0 4
    	      children [
    		Shape {
    		  geometry Text {
    		    string [ "QuadTree-USEchildren" "Native tags" ]
    		  }
    		  appearance USE WHITE
    		}
    	      ]
    	    }
    	  ]
    	  upperLeftDEFName USE UPPER_LEFT
    	  upperRightDEFName USE UPPER_RIGHT
    	  lowerLeftDEFName USE LOWER_LEFT
    	  lowerRightDEFName USE LOWER_RIGHT_EXAMPLE_2
    	}
          ]
        }
        DEF Example_3 Transform {
          translation 0 -2 0
          children [
    	QuadTree-TagChildren {
    	  upperLeftNode USE UPPER_LEFT
    	  upperRightNode USE UPPER_RIGHT
    	  lowerLeftNode USE LOWER_LEFT
    	  lowerRightNode Transform {
    	    translation -6 0 4
    	    children [
    	      Shape {
    		geometry Text {
    		  string [ "QuadTree-TagChildren" "ProtoInstance" ]
    		}
    		appearance USE WHITE
    	      }
    	    ]
    	  }
    	}
          ]
        }
        DEF Example_4 Transform {
          translation 0 -6 0
          children [
    	QuadTree-TagChildren {
    	  upperLeftNode USE UPPER_LEFT
    	  upperRightNode USE UPPER_RIGHT
    	  lowerLeftNode USE LOWER_LEFT
    	  lowerRightNode [
    	    Transform {
    	      translation -6 0 4
    	      children [
    		Shape {
    		  geometry Text {
    		    string [ "QuadTree-TagChildren" "Native tags" ]
    		  }
    		  appearance USE WHITE
    		}
    	      ]
    	    }
    	    WorldInfo {
    	      info [ "this WorldInfo is here to demonstrate that the example is type MFNode/Nodes" ]
    	    }
    	  ]
    	}
          ]
        }
      ]
    }
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    
    


  19. ScriptExample is a simple file that exercises Script and field tags.

    ScriptExample.xml, ScriptExample.html ScriptExample.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='ScriptExample.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='8 January 2000'/> <meta name='description' content='Demonstrate Script functionality, syntax'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ScriptExample.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Script DEF='myScript' url='"http://www.web3D.org/TaskGroups/x3d/translation" "a second url goes here"'>
    <field name='someSFBool' type='Boolean' vrml97Hint='eventIn'/> <field name='someMFInt32' type='Integers' vrml97Hint='eventOut'/> <field name='someMFFloats' type='Floats' value='0.0 1.0 2.0' vrml97Hint='field'/> <field name='someStringField' type='String' value='hello' vrml97Hint='exposedField'/> <field name='stringTest1' type='Strings' value='"apostrophe" "attributes"' vrml97Hint='field'/> <field name='stringTest2' type='Strings' value='"numeric" "quotes"' vrml97Hint='field'/> <field name='stringTest3' type='Strings' value='""" "quotes"' vrml97Hint='field'/> <field name='someUnhintedUninitializedRotation' type='Rotation'/> <field name='someUnhintedInitializedTime' type='Time' value='-1'/> <field name='someUnhintedUninitializedTime' type='Time'/>
    </Script>
    </Scene>
    </X3D> <-- Tag color codes: <NodeName attribute='value'/> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: ScriptExample.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 8 January 2000
    # [meta] description: Demonstrate Script functionality, syntax
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/ScriptExample.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    DEF myScript Script {
      url [ "http://www.web3D.org/TaskGroups/x3d/translation" "a second url goes here" ]
      eventIn SFBool someSFBool
      eventOut MFInt32 someMFInt32
      field MFFloat someMFFloats [ 0.0 1.0 2.0 ]
      
      # XSL-translation warning: 'exposedField' not allowed in VRML 97 Script, used 'field' instead
      field SFString someStringField "hello"
      field MFString stringTest1 [
        "apostrophe" "attributes"
      ]
      field MFString stringTest2 [
        "numeric" "quotes"
      ]
      field MFString stringTest3 [
        """ "quotes"
      ]
      field SFRotation someUnhintedUninitializedRotation 0 0 1 0
      field SFTime someUnhintedInitializedTime -1
      field SFTime someUnhintedUninitializedTime -1
    }
    


  20. ShapeChildRoutingExample shows that routing to Node children works identically in X3D as in VRML 97, regardless of whether field wrappers are included.

    ShapeChildRoutingExample.xml, ShapeChildRoutingExample.html, ShapeChildRoutingExampleUnwrapped.xml ShapeChildRoutingExample.wrl, ShapeChildRoutingExample.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='ShapeChildRoutingExample.xml'/> <meta name='Author' content='Don Brutzman'/> <meta name='Date' content='9 January 2000'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/ShapeChildRoutingExample.xml'/> <meta name='GENERATOR' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Transform>
    <children>
    <Shape DEF='A_SHAPE'>
    <geometry>
    <Box/>
    </geometry>
    </Shape> <Script DEF='A_SCRIPT'>
    <field name='geometryResult' type='Node' vrml97Hint='eventOut'/> <-- Scripting code is wrapped in a CDATA section to preserve all characters without normalization --> <![CDATA[ javascript: function initialize () { sphereResult = Browser.createVrmlFromString ('Sphere { }'); geometryResult = sphereResult [0]; // type casting MF -> SFNode } ]]>
    </Script>
    </children>
    </Transform> <ROUTE fromField='geometryResult' fromNode='A_SCRIPT' toField='geometry' toNode='A_SHAPE'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: ShapeChildRoutingExample.xml
    # [meta] Author: Don Brutzman
    # [meta] Date: 9 January 2000
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/ShapeChildRoutingExample.xml
    # [meta] GENERATOR: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    Transform {
      children [
        DEF A_SHAPE Shape {
          geometry Box {
          }
        }
        DEF A_SCRIPT Script {
          eventOut SFNode geometryResult
          # Scripting code is wrapped in a CDATA section to preserve all characters without normalization
          url "javascript:
          function initialize ()
          {
    	sphereResult = Browser.createVrmlFromString ('Sphere { }');
    	geometryResult = sphereResult [ 0 ]; // type casting MF -> SFNode
          }
          
          
          "
        }
      ]
    }
    ROUTE A_SCRIPT.geometryResult TO A_SHAPE.geometry
    
    


  21. SpinGroupInternalSubsetDeclaration shows how to compatibly define a SpinGroup prototype, either using author-defined XML tag definitions or using standard VRML PROTO mechanisms. You must look at the complete unfiltered XML source to see the precise DOCTYPE and internal entity declarations needed.

    SpinGroupInternalSubsetDeclaration.xml,
    SpinGroupInternalSubsetDeclaration.html
    SpinGroupInternalSubsetDeclaration.wrl
    <?xml version="1.0" encoding="utf-8" ?>
    <!DOCTYPE X3D PUBLIC
    	"http://www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    	"file://localhost/C:/www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd"
    [
     <!ENTITY % Vrml97Profile  "INCLUDE">
     <!ENTITY % CoreProfile    "IGNORE">
     <!ENTITY % X3dExtensions  "IGNORE">
     <!ENTITY % GeoVrmlProfile "IGNORE">
    
    <!-- SpinGroupInternalSubsetDeclaration.xml:  an example scene demonstrating
         how to extend the X3D DTD to accept and validate a new node.
    
         The extension-node type declaration goes here in the internal subset.
         It will override the null-string declaration in the external X3D DTD.
    -->
    
    <!ENTITY % GroupingNodeExtensions "SpinGroupTag | " >
    
    
    <!-- Now define the node so that content and attribute types are valid.
         This only works when child content is specified explicitly.
         The author must carefully match the DTD patterns without error!
         Complete examples for all node types are found in ProtoTagExamples.xml
    -->
    
    <!ELEMENT SpinGroupTag (fieldValue*, children?) >
    <!ATTLIST SpinGroupTag 
    	translation      NMTOKENS "0 0 0"
    	rotation         NMTOKENS "0 0 1 0"
    	center           NMTOKENS "0 0 0"
    	cycleInterval    NMTOKEN  "1"
    	nodeTypeHint     NMTOKEN  #FIXED   "Group"
    	DEF              ID       #IMPLIED 
    	USE              IDREF    #IMPLIED>
    
    
    <!-- Detailed issues and variations regarding type declarations for nodes:
    
        XML rules say that parameter entities cannot be used inside markup
        declarations in an internal subset.  Also, &GeneralEntities; cannot
        be used inside markup declarations in an internal subset.  This
        unfortunately means that all node declarations must be fully and
        explicitly enumerated, i.e. all of the parameter entity and
        general entity declarations in the external DTD are not usable.
        Bleah, too bad.  Be sure to also consider whether each of the
        declared PROTOs should allow each other as child content. 
        Example test-case node declarations follow.
    
        Correctly enumerated case for a grouping node:
    
    <!ELEMENT SpinGroupTag (fieldValue*, children?) >
    
        Simple nonvalidating/forgiving case (also good for multiple PROTOs):
      
    <!ELEMENT SpinGroupTag ANY >
    
        Nodes that contain no other content nodes are easily defined:
      
    <!ELEMENT SpinGroupTag EMPTY >
    
        Simple scene-specific case:
      
    <!ELEMENT SpinGroupTag ( children ) >
    
        The following two attempts fail regardless of entities definitions,
        again because parameter entities are not allowed in the internal subset:
      
    <!ELEMENT SpinGroupTag ( &percent;ChildrenNodes; )* >
    <!ELEMENT SpinGroupTag ( &ChildrenNodes; )* >
    
        Actual scene follows which simultaneously and compatibly using a SpinGroup
        prototype via <ProtoDeclare>, <ProtoInstance>, and <SpinGroupTag> tags.
        
    -->
    ]>
    
    <X3D>
    
    <head>
    <meta name='filename' content='SpinGroupInternalSubsetDeclaration.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='22 January 2000'/> <meta name='description' content='SpinGroup PROTO example content to test DTD modularization and extensibility'/> <meta name='url' content='http://www.web3d.org/TaskGroups/x3d/translation/examples/SpinGroupExternalDeclaration.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <-- Declaring the SpinGroupTag PROTO, so that translations of internally defined SpinGroupTag to VRML can work: --> <ProtoDeclare name='SpinGroupTag'>
    <field name='translation' type='Vector3' value='0 0 0' IS='SpinGroupTransform-TagVersion.translation' vrml97Hint='exposedField'/> <field name='rotation' type='Rotation' value='0 0 1 0' IS='SpinGroupTransform-TagVersion.rotation'/> <field name='center' type='Vector3' value='0 0 0' IS='SpinGroupTransform-TagVersion.center'/> <field name='cycleInterval' type='Time' IS='SpinGroupTimeSensor-TagVersion.cycleInterval'/> <field name='children' type='Nodes' IS='SpinGroupTransform-TagVersion.children'/> <-- SpinGroupTransform is first node, which determines node type, and encloses children for instances. --> <Transform DEF='SpinGroupTransform-TagVersion' rotation='1 0 0 0'/> <OrientationInterpolator DEF='SpinGroupOrientationInterpolator-TagVersion' keyValue='0 1 0 0.0, 0 1 0 -3.14159, 0 1 0 -6.28318' key='0.0, 0.50, 1.0'/> <TimeSensor DEF='SpinGroupTimeSensor-TagVersion' loop='true'/> <ROUTE fromNode='SpinGroupTimeSensor-TagVersion' fromField='fraction_changed' toNode='SpinGroupOrientationInterpolator-TagVersion' toField='set_fraction'/> <ROUTE fromNode='SpinGroupOrientationInterpolator-TagVersion' fromField='value_changed' toNode='SpinGroupTransform-TagVersion' toField='set_rotation'/>
    </ProtoDeclare> <ProtoDeclare name='SpinGroup'>
    <field name='translation' type='Vector3' value='0 0 0' IS='SpinGroupTransform.translation'/> <field name='rotation' type='Rotation' value='0 0 1 0' IS='SpinGroupTransform.rotation'/> <field name='center' type='Vector3' value='0 0 0' IS='SpinGroupTransform.center'/> <field name='cycleInterval' type='Time' IS='SpinGroupTimeSensor.cycleInterval'/> <field name='children' type='Nodes' IS='SpinGroupTransform.children'/> <-- SpinGroupTransform is first node, which determines node type, and encloses children for instances. --> <Transform DEF='SpinGroupTransform'/> <OrientationInterpolator DEF='SpinGroupOrientationInterpolator' keyValue='0 1 0 0.0, 0 1 0 -3.14159, 0 1 0 -6.28318' key='0.0, 0.50, 1.0'/> <TimeSensor DEF='SpinGroupTimeSensor' loop='true'/> <ROUTE fromNode='SpinGroupTimeSensor' fromField='fraction_changed' toNode='SpinGroupOrientationInterpolator' toField='set_fraction'/> <ROUTE fromNode='SpinGroupOrientationInterpolator' fromField='value_changed' toNode='SpinGroupTransform' toField='set_rotation'/>
    </ProtoDeclare> <Viewpoint position='0 0 15' description='SpinGroup Examples'/> <NavigationInfo type='EXAMINE'/> <-- Instantiating the SpinGroupTag using a customized tag: --> <SpinGroupTag DEF='instanceOne' translation='0 4 0' cycleInterval='8' center='0 0 0' nodeTypeHint='Group' rotation='0 0 1 0'>
    <children>
    <Shape>
    <appearance>
    <Appearance DEF='AQUAMARINE'>
    <material>
    <Material diffuseColor='0.1 0.8 0.8'/>
    </material>
    </Appearance>
    </appearance> <geometry>
    <Text string='SpinGroupTag example 1, single child'>
    <-- note justify attribute is type Strings, requires quotes --> <fontStyle>
    <FontStyle DEF='CENTER_FONT' justify='"MIDDLE"' style='BOLD'/>
    </fontStyle>
    </Text>
    </geometry>
    </Shape>
    </children>
    </SpinGroupTag> <-- Instantiating the SpinGroup PROTO using a ProtoInstance tag: --> <ProtoInstance name='SpinGroup' DEF='instanceTwo'>
    <fieldValue fieldName='translation' value='0 1 0'/> <fieldValue fieldName='cycleInterval' value='12'/> <children>
    <Shape>
    <geometry>
    <Text string='SpinGroup ProtoInstance example 2, single child'>
    <fontStyle>
    <FontStyle USE='CENTER_FONT'/>
    </fontStyle>
    </Text>
    </geometry>
    </Shape>
    </children>
    </ProtoInstance> <-- Instantiating the SpinGroup PROTO with multiple Node children: --> <ProtoInstance name='SpinGroup' DEF='instanceThree'>
    <fieldValue fieldName='translation' value='0 -2 0'/> <fieldValue fieldName='cycleInterval' value='20'/> <children>
    <Shape>
    <appearance>
    <Appearance USE='AQUAMARINE'/>
    </appearance> <geometry>
    <Text string='"SpinGroup ProtoInstance" "example 3, first child"'>
    <fontStyle>
    <FontStyle USE='CENTER_FONT'/>
    </fontStyle>
    </Text>
    </geometry>
    </Shape> <Transform translation='0 -2 0'>
    <children>
    <Shape>
    <geometry>
    <Text string='example 3, second child'>
    <fontStyle>
    <FontStyle USE='CENTER_FONT'/>
    </fontStyle>
    </Text>
    </geometry>
    </Shape>
    </children>
    </Transform>
    </children>
    </ProtoInstance>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: SpinGroupInternalSubsetDeclaration.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 22 January 2000
    # [meta] description: SpinGroup PROTO example content to test DTD modularization and extensibility
    # [meta] url: http://www.web3d.org/TaskGroups/x3d/translation/examples/SpinGroupExternalDeclaration.xml
    # [meta] generator: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    # Declaring the SpinGroupTag PROTO, so that translations of internally defined SpinGroupTag to VRML can work:
    PROTO SpinGroupTag [
      exposedField SFVec3f translation 0 0 0
      exposedField SFRotation rotation 0 0 1 0
      exposedField SFVec3f center 0 0 0
      exposedField SFTime cycleInterval -1
      exposedField MFNode children [ ]
      # SpinGroupTransform is first node, which determines node type, and encloses children for instances.
    ] {
      # SpinGroupTransform is first node, which determines node type, and encloses children for instances.
      DEF SpinGroupTransform-TagVersion Transform {
        translation IS translation
        rotation IS rotation
        center IS center
        children IS children
        rotation 1 0 0 0
      }
      DEF SpinGroupOrientationInterpolator-TagVersion OrientationInterpolator {
        keyValue [ 0 1 0 0.0, 0 1 0 -3.14159, 0 1 0 -6.28318 ]
        key [ 0.0, 0.50, 1.0 ]
      }
      DEF SpinGroupTimeSensor-TagVersion TimeSensor {
        cycleInterval IS cycleInterval
        loop TRUE
      }
      ROUTE SpinGroupTimeSensor-TagVersion.fraction_changed TO SpinGroupOrientationInterpolator-TagVersion.set_fraction
      ROUTE SpinGroupOrientationInterpolator-TagVersion.value_changed TO SpinGroupTransform-TagVersion.set_rotation
    }
    PROTO SpinGroup [
      exposedField SFVec3f translation 0 0 0
      exposedField SFRotation rotation 0 0 1 0
      exposedField SFVec3f center 0 0 0
      exposedField SFTime cycleInterval -1
      exposedField MFNode children [ ]
      # SpinGroupTransform is first node, which determines node type, and encloses children for instances.
    ] {
      # SpinGroupTransform is first node, which determines node type, and encloses children for instances.
      DEF SpinGroupTransform Transform {
        translation IS translation
        rotation IS rotation
        center IS center
        children IS children
      }
      DEF SpinGroupOrientationInterpolator OrientationInterpolator {
        keyValue [ 0 1 0 0.0, 0 1 0 -3.14159, 0 1 0 -6.28318 ]
        key [ 0.0, 0.50, 1.0 ]
      }
      DEF SpinGroupTimeSensor TimeSensor {
        cycleInterval IS cycleInterval
        loop TRUE
      }
      ROUTE SpinGroupTimeSensor.fraction_changed TO SpinGroupOrientationInterpolator.set_fraction
      ROUTE SpinGroupOrientationInterpolator.value_changed TO SpinGroupTransform.set_rotation
    }
    Viewpoint {
      position 0 0 15
      description "SpinGroup Examples"
    }
    NavigationInfo {
      type [ "EXAMINE" ]
    }
    # Instantiating the SpinGroupTag using a customized tag:
    DEF instanceOne SpinGroupTag {
      translation 0 4 0
      cycleInterval 8
      center 0 0 0
      rotation 0 0 1 0
      children [
        Shape {
          appearance DEF AQUAMARINE Appearance {
    	material Material {
    	  diffuseColor 0.1 0.8 0.8
    	}
          }
          geometry Text {
    	string [ "SpinGroupTag example 1, single child" ]
    	# note justify attribute is type Strings, requires quotes
    	fontStyle DEF CENTER_FONT FontStyle {
    	  justify [ "MIDDLE" ]
    	  style "BOLD"
    	}
          }
        }
      ]
    }
    # Instantiating the SpinGroup PROTO using a ProtoInstance tag:
    DEF instanceTwo SpinGroup {
      children [
        Shape {
          geometry Text {
    	string [ "SpinGroup ProtoInstance example 2, single child" ]
    	fontStyle USE CENTER_FONT
          }
        }
      ]
      translation 0 1 0
      cycleInterval 12
    }
    # Instantiating the SpinGroup PROTO with multiple Node children:
    DEF instanceThree SpinGroup {
      children [
        Shape {
          appearance USE AQUAMARINE
          geometry Text {
    	string [ "SpinGroup ProtoInstance" "example 3, first child" ]
    	fontStyle USE CENTER_FONT
          }
        }
        Transform {
          translation 0 -2 0
          children [
    	Shape {
    	  geometry Text {
    	    string [ "example 3, second child" ]
    	    fontStyle USE CENTER_FONT
    	  }
    	}
          ]
        }
      ]
      translation 0 -2 0
      cycleInterval 20
    }
    


  22. WrapperTagsExample shows that the earlier (February 2000) Document Type Definition (DTD) x3d-draft.dtd can handle the proposed wrapper tags (<children> etc.). This example also shows how such wrappers double all tags to add bloat - the number of tags went from 33 to 67. This example also shows that the topology of the scene graph becomes different than a VRML 97 scene graph. This problem is very significant and unavoidable for autogenerated DOM-compliant components. The duplicate node problem occurs because, unlike all the other tags in X3D, wrappers are merely field labels rather than actual nodes that affect rendering.

    A useful check that proves wrapper tags are not needed: they add no information. There is already a one-to-one correspondence between X3D and VRML 97 without wrapper tags.

    Since the field names corresponding to VRML 97 nodes are well defined, each corresponds directly and unambiguously to parent nodes. This was a primary issue in the "wrapper tag" debate January-March 2000. Further discussion on this topic is available at

    WrapperTagsExample.xml, WrapperTagsExample.html WrapperTagsExample.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='WrapperTagsExample.xml'/> <meta name='description' content='"Demonstrate/test field-name wrapper tags" "Scene includes 33 node tags, 34 wrapper tags, 67 tags total"'/> <meta name='revised' content='21 April 2000'/> <meta name='author' content='Don Brutzman'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/WrapperTagsExample.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <Transform translation='0 -3 0'>
    <children>
    <Shape>
    <-- *** wrapper tag *** --> <geometry>
    <Cylinder height='1.5' radius='.75'/> <-- *** wrapper tag *** -->
    </geometry> <-- *** wrapper tag *** --> <appearance>
    <Appearance>
    <-- *** wrapper tag *** --> <texture>
    <ImageTexture url='"earth-topo-small.png" "earth-topo-small.gif"'/> <-- *** wrapper tag *** -->
    </texture> <-- *** wrapper tag *** --> <textureTransform>
    <TextureTransform rotation='-2.356' scale='1 1'/> <-- *** wrapper tag *** -->
    </textureTransform>
    </Appearance> <-- *** wrapper tag *** -->
    </appearance>
    </Shape> <-- *** wrapper tag *** -->
    </children>
    </Transform> <LOD center='0 0 0'>
    <level>
    <Shape>
    <-- *** wrapper tag *** --> <appearance>
    <Appearance>
    <-- *** wrapper tag *** --> <material>
    <Material diffuseColor='.6 .1 .1'/> <-- *** wrapper tag *** -->
    </material>
    </Appearance> <-- *** wrapper tag *** -->
    </appearance> <-- *** wrapper tag *** --> <geometry>
    <Text string='"wrapper tags are " "field container names" "that hold nodes"'>
    <-- *** wrapper tag *** --> <fontStyle>
    <FontStyle justify='"MIDDLE"'/> <-- *** wrapper tag *** -->
    </fontStyle>
    </Text> <-- *** wrapper tag *** -->
    </geometry>
    </Shape> <Sound>
    <-- *** wrapper tag *** --> <source>
    <AudioClip stopTime='0'/> <-- *** wrapper tag *** -->
    </source>
    </Sound> <-- *** wrapper tag *** -->
    </level>
    </LOD> <Switch whichChoice='0'>
    <choice>
    <Shape>
    <-- *** wrapper tag *** --> <geometry>
    <IndexedFaceSet coordIndex='0 1 2 3 -1'>
    <-- *** wrapper tag *** --> <color>
    <Color color='0 0 1, 0 1 0, 1 0 0, 1 1 1'/> <-- *** wrapper tag *** -->
    </color> <-- *** wrapper tag *** --> <coord>
    <Coordinate point='-5 -3 -2, 5 -3 -2, 5 1 -2, -5 1 -2'/> <-- *** wrapper tag *** -->
    </coord> <-- *** wrapper tag *** --> <normal>
    <Normal vector='0 0 -1, 0 0 -1, 0 0 -1, 0 0 -1'/> <-- *** wrapper tag *** -->
    </normal> <-- *** wrapper tag *** --> <texCoord>
    <TextureCoordinate point='-1 -1, -1 1, 1 1, 1 -1'/> <-- *** wrapper tag *** -->
    </texCoord>
    </IndexedFaceSet> <-- *** wrapper tag *** -->
    </geometry>
    </Shape> <-- *** wrapper tag *** -->
    </choice>
    </Switch> <NavigationInfo type='"EXAMINE" "ANY"'/>
    </Scene>
    </X3D> <-- Tag color codes: <field> <NodeName attribute='value'/> </field> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: WrapperTagsExample.xml
    # [meta] description: "Demonstrate/test field-name wrapper tags" "Scene includes 33 node tags, 34 wrapper tags, 67 tags total"
    # [meta] revised: 21 April 2000
    # [meta] author: Don Brutzman
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/WrapperTagsExample.xml
    # [meta] generator: X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    Transform {
      translation 0 -3 0
      children [
        Shape {
          # *** wrapper tag ***
          geometry Cylinder {
    	height 1.5
    	radius .75
          }
          # *** wrapper tag ***
          # *** wrapper tag ***
          appearance Appearance {
    	# *** wrapper tag ***
    	texture ImageTexture {
    	  url [ "earth-topo-small.png" "earth-topo-small.gif" ]
    	}
    	# *** wrapper tag ***
    	# *** wrapper tag ***
    	textureTransform TextureTransform {
    	  rotation -2.356
    	  scale 1 1
    	}
    	# *** wrapper tag ***
          }
          # *** wrapper tag ***
        }
      ]
    }
    LOD {
      center 0 0 0
      level [
        Shape {
          # *** wrapper tag ***
          appearance Appearance {
    	# *** wrapper tag ***
    	material Material {
    	  diffuseColor .6 .1 .1
    	}
    	# *** wrapper tag ***
          }
          # *** wrapper tag ***
          # *** wrapper tag ***
          geometry Text {
    	string [ "wrapper tags are " "field container names" "that hold nodes" ]
    	# *** wrapper tag ***
    	fontStyle FontStyle {
    	  justify [ "MIDDLE" ]
    	}
    	# *** wrapper tag ***
          }
          # *** wrapper tag ***
        }
        Sound {
          # *** wrapper tag ***
          source AudioClip {
    	stopTime 0
          }
          # *** wrapper tag ***
        }
      ]
    }
    Switch {
      whichChoice 0
      choice [
        Shape {
          # *** wrapper tag ***
          geometry IndexedFaceSet {
    	coordIndex [ 0 1 2 3 -1 ]
    	# *** wrapper tag ***
    	color Color {
    	  color [ 0 0 1, 0 1 0, 1 0 0, 1 1 1 ]
    	}
    	# *** wrapper tag ***
    	# *** wrapper tag ***
    	coord Coordinate {
    	  point [ -5 -3 -2, 5 -3 -2, 5 1 -2, -5 1 -2 ]
    	}
    	# *** wrapper tag ***
    	# *** wrapper tag ***
    	normal Normal {
    	  vector [ 0 0 -1, 0 0 -1, 0 0 -1, 0 0 -1 ]
    	}
    	# *** wrapper tag ***
    	# *** wrapper tag ***
    	texCoord TextureCoordinate {
    	  point [ -1 -1, -1 1, 1 1, 1 -1 ]
    	}
    	# *** wrapper tag ***
          }
          # *** wrapper tag ***
        }
      ]
    }
    NavigationInfo {
      type [ "EXAMINE" "ANY" ]
    }
    


  23. X3dRetreatProtoExercise presents a series of examples in a single scene provided as solutions to the Proto Exercise posed by Chris Marrin of SONY at the X3D Retreat. Several of these examples included invalid VRML syntax, which can be expressed in X3D but is not necessarily translatable back into VRML 97. Thus the VRML translation includes unavoidable syntactic and semantic errors. In any case, these are helpful and interesting examples.

    X3dRetreatProtoExercise.xml, X3dRetreatProtoExercise.html X3dRetreatProtoExercise.wrl
    <X3D>
    
    <head>
    <meta name='filename' content='X3dRetreatProtoExercise.xml'/> <meta name='author' content='Don Brutzman'/> <meta name='revised' content='16 April 2000'/> <meta name='description' content='Solutions to the Proto Exercise posed by Chris Marrin of SONY at the X3D Retreat.'/> <meta name='reference' content='http://www.web3D.org/TaskGroups/x3d/sony/X3dRetreatProtoEx.html'/> <meta name='url' content='http://www.web3D.org/TaskGroups/x3d/translation/examples/X3dRetreatProtoExercise.xml'/> <meta name='generator' content='X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
    </head> <Scene>
    <-- ============= Example 1 ============= --> <-- GeometryNode and ChildNode are not valid node types, so used type Node/Nodes instead. --> <-- Note exercise example is incomplete and has no node(s) defined for body content. --> <-- X3D DTD can correctly detect these content errors if they occur, scene will be well-formed but not valid. --> <ProtoDeclare name='MyProto'>
    <field name='geometry' type='Node' value='NULL'/> <field name='children' type='Nodes' value='NULL'/> <WorldInfo info='Added this node as PROTO body, so that the example can be valid VRML'/>
    </ProtoDeclare> <-- ============= Example 2 ============= --> <-- Adding new fields to an existing node. --> <-- Corrected example by moving Material from PROTO interface to PROTO body. --> <ProtoDeclare name='PhysicalMaterial'>
    <field name='mass' type='Float' value='1'/> <field name='hardness' type='Float' value='1'/> <field name='friction' type='Float' value='1'/> <Material DEF='M'/> <-- EXPORT M (this is Blendo nomenclature, not VRML 97) -->
    </ProtoDeclare> <-- ============= Example 3a ============= --> <-- Consider new possibility of declaring a field PROTO. --> <-- Again no body provided in this example (since goal is a new FieldPROTO construct). --> <ProtoDeclare name='Plane'>
    <-- FIELDPROTO --> <field name='normal' type='Vector3' value='0 0 1'/> <field name='distance' type='Float' value='0'/> <WorldInfo info='Added this node as PROTO body, so that the example can be valid VRML'/>
    </ProtoDeclare> <-- ============= Example 3b ============= --> <-- Example 3b employs the supposed field PROTO. --> <-- X3D DTD currently restricts field types to VRML 97 types, and so flags these untyped fields as an error. --> <-- We could allow unspecified field types, but would lose checking (and authoring suggestions) on existing types. --> <ProtoDeclare name='BSPLeaf'>
    <-- Intentionally invalid type values used. --> <field name='plane' type='Plane' value='0 0 1 0'/> <field name='front' type='BSPLeaf' value='NULL'/> <field name='back' type='BSPLeaf' value='NULL'/> <field name='children' type='Nodes' value='NULL'/> <WorldInfo info='Added this node as PROTO body, so that the example can be valid VRML'/>
    </ProtoDeclare> <-- ============= Example 4 ============= --> <-- PROTO with routes. Example nodes moved from interface definition to body. --> <ProtoDeclare name='SpinGroup'>
    <-- Example 4 calls three of the field references ROUTEs, but they actually match VRML 97 'IS' statements. --> <field IS='TS.cycleInterval' name='speed' type='Time' value='1'/> <field IS='TS.startTime' name='startTime' type='Time' value='0'/> <field IS='TS.stopTime' name='stopTime' type='Time' value='0'/> <-- Corrected example by moving nodes T, G, TS and OI from PROTO interface to PROTO body. --> <Transform DEF='T'>
    <Group DEF='G'/> <-- EXPORT G (this is Blendo nomenclature, not VRML 97) -->
    </Transform> <TimeSensor DEF='TS' loop='true'/> <OrientationInterpolator DEF='OI' key='0 0.25 0.5 0.75 1' keyValue='0 1 0 0, 0 1 0 1.57, 0 1 0 3.14, 0 1 0 4.71, 0 1 0 0'/> <ROUTE fromField='fraction_changed' fromNode='TS' toField='set_fraction' toNode='OI'/> <ROUTE fromField='value_changed' fromNode='OI' toField='set_rotation' toNode='T'/>
    </ProtoDeclare> <-- ============= Example 5 ============= --> <-- Show "overriding of a method of the inherited interface." --> <-- X3D DTD currently restricts field types to VRML 97 types, other values can be entered but are flagged as invalid. --> <ProtoDeclare name='BSPLeaf'>
    <field IS='RENDERscript.plane' name='plane' type='Plane' value='0 0 1 0'/> <field IS='RENDERscript.front' name='front' type='BSPLeaf' value='NULL'/> <field IS='RENDERscript.back' name='back' type='BSPLeaf' value='NULL'/> <-- Here is a curious example problem: an unattached function overriding an unspecified (but commonly occuring) implementation-specific browser function. --> <-- This solution wraps a Script node around the render () function to maintain VRML 97 semantics. --> <-- Preprocessing can automate this process of wrapping a Script node around inline functions. --> <-- Corrected example by moving Group G (renamed GG) from PROTO interface to PROTO body. --> <Group DEF='GG'/> <Script DEF='RENDERscript'>
    <![CDATA[ javascript: function render() { var result = plane.onPlane(System.sceneManager.getCameraPos()); if (result < 0) { front.render(); G.render(); back.render(); } else if (result > 0) { back.render(); G.render(); front.render(); } else { front.render(); back.render(); } } ]]>
    </Script>
    </ProtoDeclare> <-- ============= Example 6 ============= --> <-- Show "inclusion of field scripts which execute whenever the field receives an event." --> <ProtoDeclare name='AnimatedMaterial'>
    <-- FROM is Blendo nomenclature, expressed using IS references. --> <field IS='timeBase.startTime' name='startTime' type='Time' value='0'/> <field IS='timeBase.stopTime' name='stopTime' type='Time' value='0'/> <field name='startColor' type='Color' value='0 0 0'/> <field name='endColor' type='Color' value='0 0 0'/> <-- During the December 3 1999 x3d-contributors meeting, Chris showed how --> <-- the VRML 97 specification allows an SF/MFNode field node to be initialized with node content. --> <-- This construct is now permitted by DTD, here is an example: --> <field name='initializedChildren' type='Nodes'>
    <Group bboxCenter='1 2 3'/> <Transform translation='1 2 3'/>
    </field> <-- Moved the following content nodes from PROTO interface to PROTO body in order to match valid VRML 97 content. --> <Material DEF='MM'/> <ProtoInstance name='IntervalSensor'>
    <ProtoInstance DEF='timeBase' name='TimeBase'/>
    </ProtoInstance> <ColorInterpolator DEF='CI' key='0 0.5 1'/> <Script DEF='AnimatedMaterialInitialize'>
    <![CDATA[ javascript: { // simple exercise for reader to initialize/update PROTO field values // to the MM Material node. Be sure to add some IS statements to match. } ]]>
    </Script> <ROUTE fromField='value_changed' fromNode='CI' toField='set_diffuseColor' toNode='MM'/>
    </ProtoDeclare>
    </Scene>
    </X3D> <-- Tag color codes: <NodeName attribute='value'/> -->
    #VRML V2.0 utf8
    # X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xsl
    # http://www.web3D.org/TaskGroups/x3d/translation/X3dToVrml97.xsl
    
    # [X3D]
    # [Header]
    # [meta] filename: X3dRetreatProtoExercise.xml
    # [meta] author: Don Brutzman
    # [meta] revised: 16 April 2000
    # [meta] description: Solutions to the Proto Exercise posed by Chris Marrin of SONY at the X3D Retreat.
    # [meta] reference: http://www.web3D.org/TaskGroups/x3d/sony/X3dRetreatProtoEx.html
    # [meta] url: http://www.web3D.org/TaskGroups/x3d/translation/examples/X3dRetreatProtoExercise.xml
    # [meta] generator: X3D-Edit, http://www.web3D.org/TaskGroups/x3d/translation/README.X3D-Edit.html
    # [Scene]
    
    # ============= Example 1 =============
    # GeometryNode and ChildNode are not valid node types, so used type Node/Nodes instead.
    # Note exercise example is incomplete and has no node(s) defined for body content.
    # X3D DTD can correctly detect these content errors if they occur, scene will be well-formed but not valid.
    PROTO MyProto [
      exposedField SFNode geometry NULL
      exposedField MFNode children [ NULL ]
    ] {
      WorldInfo {
        info [ "Added this node as PROTO body, so that the example can be valid VRML" ]
      }
    }
    # ============= Example 2 =============
    # Adding new fields to an existing node.
    # Corrected example by moving Material from PROTO interface to PROTO body.
    PROTO PhysicalMaterial [
      exposedField SFFloat mass 1
      exposedField SFFloat hardness 1
      exposedField SFFloat friction 1
      # EXPORT M (this is Blendo nomenclature, not VRML 97)
    ] {
      DEF M Material {
      }
      # EXPORT M (this is Blendo nomenclature, not VRML 97)
    }
    # ============= Example 3a =============
    # Consider new possibility of declaring a field PROTO.
    # Again no body provided in this example (since goal is a new FieldPROTO construct).
    PROTO Plane [
      # FIELDPROTO
      exposedField SFVec3f normal 0 0 1
      exposedField SFFloat distance 0
    ] {
      # FIELDPROTO
      WorldInfo {
        info [ "Added this node as PROTO body, so that the example can be valid VRML" ]
      }
    }
    # ============= Example 3b =============
    # Example 3b employs the supposed field PROTO.
    # X3D DTD currently restricts field types to VRML 97 types, and so flags these untyped fields as an error.
    # We could allow unspecified field types, but would lose checking (and authoring suggestions) on existing types.
    PROTO BSPLeaf [
      # Intentionally invalid type values used.
      exposedField Plane plane 0 0 1 0 # unknown type!
      exposedField BSPLeaf front NULL # unknown type!
      exposedField BSPLeaf back NULL # unknown type!
      exposedField MFNode children [ NULL ]
    ] {
      # Intentionally invalid type values used.
      WorldInfo {
        info [ "Added this node as PROTO body, so that the example can be valid VRML" ]
      }
    }
    # ============= Example 4 =============
    # PROTO with routes. Example nodes moved from interface definition to body.
    PROTO SpinGroup [
      # Example 4 calls three of the field references ROUTEs, but they actually match VRML 97 'IS' statements.
      exposedField SFTime speed 1
      exposedField SFTime startTime 0
      exposedField SFTime stopTime 0
      # Corrected example by moving nodes T, G, TS and OI from PROTO interface to PROTO body.
    ] {
      # Example 4 calls three of the field references ROUTEs, but they actually match VRML 97 'IS' statements.
      # Corrected example by moving nodes T, G, TS and OI from PROTO interface to PROTO body.
      DEF T Transform {
        children [
          DEF G Group {
          }
          # EXPORT G (this is Blendo nomenclature, not VRML 97)
        ]
      }
      DEF TS TimeSensor {
        cycleInterval IS speed
        startTime IS startTime
        stopTime IS stopTime
        loop TRUE
      }
      DEF OI OrientationInterpolator {
        key [ 0 0.25 0.5 0.75 1 ]
        keyValue [ 0 1 0 0, 0 1 0 1.57, 0 1 0 3.14, 0 1 0 4.71, 0 1 0 0 ]
      }
      ROUTE TS.fraction_changed TO OI.set_fraction
      ROUTE OI.value_changed TO T.set_rotation
    }
    # ============= Example 5 =============
    # Show "overriding of a method of the inherited interface."
    # X3D DTD currently restricts field types to VRML 97 types, other values can be entered but are flagged as invalid.
    PROTO BSPLeaf [
      exposedField Plane plane 0 0 1 0 # unknown type!
      exposedField BSPLeaf front NULL # unknown type!
      exposedField BSPLeaf back NULL # unknown type!
      # Here is a curious example problem: an unattached function overriding an unspecified (but commonly occuring) implementation-specific browser function.
      # This solution wraps a Script node around the render () function to maintain VRML 97 semantics.
      # Preprocessing can automate this process of wrapping a Script node around inline functions.
      # Corrected example by moving Group G (renamed GG) from PROTO interface to PROTO body.
    ] {
      # Here is a curious example problem: an unattached function overriding an unspecified (but commonly occuring) implementation-specific browser function.
      # This solution wraps a Script node around the render () function to maintain VRML 97 semantics.
      # Preprocessing can automate this process of wrapping a Script node around inline functions.
      # Corrected example by moving Group G (renamed GG) from PROTO interface to PROTO body.
      DEF GG Group {
      }
      DEF RENDERscript Script {
        url "javascript:
        function render()
        {
          var result = plane.onPlane(System.sceneManager.getCameraPos());
          if (result < 0) {
    	front.render();
    	G.render();
    	back.render();
          }
          else if (result > 0) {
    	back.render();
    	G.render();
    	front.render();
          }
          else {
    	front.render();
    	back.render();
          }
        }
        
        "
      }
    }
    # ============= Example 6 =============
    # Show "inclusion of field scripts which execute whenever the field receives an event."
    PROTO AnimatedMaterial [
      # FROM is Blendo nomenclature, expressed using IS references.
      exposedField SFTime startTime 0
      exposedField SFTime stopTime 0
      exposedField SFColor startColor 0 0 0
      exposedField SFColor endColor 0 0 0
      # During the December 3 1999 x3d-contributors meeting, Chris showed how
      # the VRML 97 specification allows an SF/MFNode field node to be initialized with node content.
      # This construct is now permitted by DTD, here is an example:
      exposedField MFNode initializedChildren [
        Group {
          bboxCenter 1 2 3
        }
        Transform {
          translation 1 2 3
        }
      ]
      # Moved the following content nodes from PROTO interface to PROTO body in order to match valid VRML 97 content.
    ] {
      # FROM is Blendo nomenclature, expressed using IS references.
      # During the December 3 1999 x3d-contributors meeting, Chris showed how
      # the VRML 97 specification allows an SF/MFNode field node to be initialized with node content.
      # This construct is now permitted by DTD, here is an example:
      # Moved the following content nodes from PROTO interface to PROTO body in order to match valid VRML 97 content.
      DEF MM Material {
      }
      IntervalSensor {
        # XSL-translation warning: nodeTypeHint unknown for TimeBase
        DEF timeBase TimeBase {
        }
      }
      DEF CI ColorInterpolator {
        key [ 0 0.5 1 ]
      }
      DEF AnimatedMaterialInitialize Script {
        url "javascript:
        { // simple exercise for reader to initialize/update PROTO field values
          // to the MM Material node. Be sure to add some IS statements to match.
        }    
        "
      }
      ROUTE CI.value_changed TO MM.set_diffuseColor
    }
    


  24. Revised: 28 November 2000.

    Your feedback is welcome. Please send e-mail comments to the X3D Task Group chair Don Brutzman (brutzman@nps.navy.mil) or subscribe to the appropriate X3D mailing list.

    The Uniform Resource Locator (URL) for this home page is www.web3D.org/TaskGroups/x3d/translation/examples/examples.html