LANG: VRML Test Document

[email protected]
Tue, 23 Aug 94 19:27:44 EDT


:: From: Dave Raggett <[email protected]>
:: Subject: Re: Results of the VRML Survey
:: To: [email protected]
:: Date: Tue, 23 Aug 94 14:52:02 BST
::
:: I believe that although the display engine works best with tree like
:: data structures for scene description (PEX works this way); it is
:: much better to describe scenes for interchange purposes in an object
:: oriented manner with simple inheritance of properties. You should be
:: able to use lexical scope to overide properties like surface material
:: and color. As far as I can see, Inventor seems a bit weak on this point.
::
:: Another point, which is critical to linking VRML with scripts, is the
:: ability to have an extendable data model for objects. The goal here is
:: to allow for high level descriptions of objects to be defined in VRML.
:: I want to be able to define an object, say "house" and to give it
:: some parameters, say "4 bedrooms" and "double garage", that are not
:: a priori part of the language. Declarative programming languages like
:: Prolog and Lisp provide direct support for this kind of thing and VRML
:: needs to do the same. The semantics are then defined by linking the
:: VRML to scripts that recognise these tags. The common tags can be
:: considered formally in the same way; its just that the "scripts" for
:: these are considered to be built-in to every VRML 0.1 viewer.
::
:: The way forward then, is a simple object-oriented language that allows
:: authors to describe objects a) in terms of standard geometric primitives
:: and b) as arbitary collections of tagged data. This is where the "markup"
:: bit of VRML comes in. The core grammar for VRML is really very simple.
:: "Document type definitions" are then used to define how this core syntax
:: is restricted for particular classes of objects, i.e. what tags and what
:: types of data are expected in each context. This approach allows for
:: an open-ended description of novel object classes, while allowing such
:: descriptions to be validated against formal DTDs for those classes (We
:: may want to use a different term for these grammar fragments).
::

Just to get the ball rolling, from my perspective, I put together this
quickly thought out and highly incomplete sample VRML document. I realize
that HTML syntax is probably not the way people are headed but, hey, it's
an example.

Borrowing from my limited use of html here is an imaginary VRML document:

<a href="vrml://nothing.domain.country/virtual/house.vrml"> Virtual World </a>

<!-- vot = virtual object tree - sub-objects related and grouped >
<!-- li = list item >
<!-- id = item definition >
<!-- space = some method for relating positions and relations of objects >

<vot>

<li> House=cube:40x40x40:blue:wood_texture:etc.

<!-- volumes(cubes, spheres) would all have an inside and an outside >

<id> garage=cube:10x10x10:blue:wood_texture:immobile:etc.
<space>
specify_position_somehow
</space>
<vot>
<li> car=rectangle:1x2x3:rad_yellow:metallic_smooth:immobile:etc.
<space>
specify_position_somehow
</space>
</vot>

<id> bedroom=cube:10x10x10:red:wood_texture:immobile:etc.
<space>
specify_position_somehow
</space>

<id> living_room=cube:10x10x10:green:wood_smooth:immobile:etc.
<space>
specify_position_somehow
</space>

<id> dining_room=cube:10x10x10:yellow:wood_texture:immobile:etc.
<space>
specify_position_somehow
</space>

<!-- all room cubes are inside of House cube by inclusion in list >

</l1>

<li> Yard=plane:60x60x60:green:grass_texture:immobile:etc.

<id> House
<space>
specify_position_somehow
</space>

<id> Driveway
<space>
specify_position_somehow
</space>

<id> Shrubbery
<space>
specify_position_somehow
</space>

</li>

</vot>

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

Robert K. Foster
Analyst / Designer / Programmer
Mid-Michigan MRI, Inc., Lansing, MI, USA
[email protected]