Looking at X3D and VRML
Comparing X3D's XML encoding with good ole' VRML encoding
 Join The Discussion
"e;Post your glossary suggestions..."
web3d.guide
 
 Related Resources
• Simple Intro to X3D
• blaxxun3D and shout3D
 
 From Other Guides
• HTML/XML
• Graphics Software
• Art/Technology
 

Dateline: 11/29/00

X3D the much heralded future of VRML is actually moving along quite nicely! While many people have contributed to various aspects of X3D, Don Brutzman a key member of the Web3D Consortium's Board of Directors for several years, has managed to cajole, bully and persevere through a lot of issues to produce a workable XMLization of VRML. Let's just look at what's here now.

One of the terrific resources now available is a set automatically produced translation of VRML97 files to X3D files. The entire set of VRML97 files used in the fabulous book "VRML2.0 Sourcebook" by Ames, Nadeau, and Moreland was translated and is available in set of handy dandy pages at:

http://web3d.org/TaskGroups/x3d/translation/examples/Vrml2.0Sourcebook/toc.html
This is truly a great resource that Don completed in the not too distant past.

Let's examine a couple of these examples a little closer to try to get a better feel for the corresponding nature of the two syntaxes involved. First a little clarification on terminology. We are dealing with two encodings of a scene graph. One encoding the new one called X3D is an XML encoding. The old encoding really had no name it was just good ole' fashined VRML, so in lieu of some other name I'll simply call it the GOFVE (Good Ole' Fashioned VRML Encoding).

Let's look in detail at Figure 3.09 a 3D Plus Sign.


#VRML V2.0 utf8
Group {
  children [
    Shape {
      appearance Appearance {
	material DEF WHITE Material {
	  diffuseColor 1 1 1
	}
      }
      geometry Box {
	size 25 2 2
      }
    }
    Shape {
      appearance Appearance {
	material USE WHITE
      }
      geometry Box {
	size 2 25 2
      }
    }
    Shape {
      appearance Appearance {
	material USE WHITE
      }
      geometry Box {
	size 2 2 25
      }
    }
  ]
}

Nothing complicated, very straightforward three boxes with a few some DEF/USE of a color and not a transform in site.

The X3D of the same VRML files is as follows: (I've stripped out comments and extra meta information from the original which you can see at the source location URL stated above)

<?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">
<X3D>
<Header> </Header> <Scene> <Group>
<children>
<Shape>
<appearance>
<Appearance>
<material>
<Material DEF='WHITE' diffuseColor='1 1 1'/>
</material>
</Appearance>
</appearance> <geometry>
<Box size='25 2 2'/>
</geometry>
</Shape> <Shape>
<appearance>
<Appearance>
<material>
<Material USE='WHITE'/>
</material>
</Appearance>
</appearance> <geometry>
<Box size='2 25 2'/>
</geometry>
</Shape> <Shape>
<appearance>
<Appearance>
<material>
<Material USE='WHITE'/>
</material>
</Appearance>
</appearance> <geometry>
<Box size='2 2 25'/>
</geometry>
</Shape>
</children>
</Group>
</Scene> </X3D>

Each VRML node has a corresponding XML entity. Clearly the X3D is more verbose and somewhat more difficult to read but not unreasonably so. In addition I'd expect that for any substantial hand editing an editor that understands the structure of XML would be used. Similarly editors that understand VRML are used now, such as for example VRMLPad from ParallalGraphics.

Let's make this more interesting and look in more detail at a subsection of the files. One of the Shapes in VRML is:

Shape {
      appearance Appearance {
	material USE WHITE
      }
      geometry Box {
	size 2 25 2
      }
    }

The corresponding X3D file fragment is:

<Shape>
<appearance>
<Appearance>
<material>
<Material USE='WHITE'/>
</material>
</Appearance>
</appearance> <geometry>
<Box size='2 25 2'/>
</geometry>
</Shape>

The rules for the XML are spelled out in the DTD which defines X3D located at:

http://www.web3D.org/TaskGroups/x3d/translation/x3d-compromise.dtd

There's obviously a lot more that's gone into the design of X3D. This will hopefully get you interested and gives you a little taste. The future of the Web is XML and the future for 3D on the Web is X3D. The potential for 3D as a first class citizen of the Web is almost here.

ZZZNEWSLETTERSIGNUP1ZZZ
[Tutorials] [Web3D Technology Comparison] [Virtual Humans]
[Virtual Reality] [Art] [People of Web3D]
[Panoramic Imaging] [FAQs] [Companies]