School of Computing

CO641 x3d / VRML material - REJ

X3d and VRML

Contents

Recommended texts
Activities for each week
Lecture summary
Software
Help with VRML
VRML gallery

Recommended texts

For VRML, we recommend

  1. VRML 2.0 Handbook: building moving worlds on the web, by Jed Hartman and Josie Wernecke. Although a little old, it does have the advantage that its examples are correct. It's also easy to navigate as a reference book. Note that the given in the book to its website has broken: its new home is here (I'm not sure how much of this overlaps with the examples link above).
  2. X3D: Extensible 3D Graphics for Web Authors by Don Brutzman and Leonard Daly is the best text I have found on x3d. However, it does not provide as clear a guide to x3d as the Hartman and Wernecke book does to VRML.

Activities for each week

Here follows a plan for the x3d/vrml part of the course.

  1. Make sure you can use a VRML or X3d plugin for your browser, or a stand-alone tool (see the Software section below. Look at some of the examples in the gallery of previous assessments. Try some of the examples from the slides. Note that the slides contain more examples than I showed in the lectures.

    Take a look at the VRML97 (local) or X3D specification which will also be very useful for the assessment.

  2. Make sure you understand how to use PROTOs. What is the difference between a field and a exposedField? What types does VRML provide? How does X3d name these entities?
  3. How do Interpolators work? How can you send an event from one node to another? What type of components in the nodes are involved (e.g. fields, exposedFields, eventIns or eventOuts? Write a simple VRML or X3D program that moves an object.

    Have a look at the following ...
    a. Look at Coordinate node and how it is used in the IndexFaceSet geometry, for example.
    b. Think about events. The event structure is strongly typed, thus you should think about how you could ROUTE something of one type to something of another (different) type. E.g. how could you ROUTE information from MFVec3f to SFVec3f.
    c. It is easy to see how to ROUTE one-to-many, but how can you ROUTE many-to-one? What use would this have, think of an example?
    d. The Anchor node is a group node that contains other things; what happens when you incorporate an Anchor node within an Anchor node - which one wins (the outer or inner)?
    e. Find out about the following concepts: Level of detail (LOD), how to create a Head-up-display (HUD), Proxy shape in Collision detection, Prototype.
    f. You may like to look futher into: Document Object Model hierarchy (DOM), back-face-culling, event scheduling within VRML.

    VRML EXAMPLES.

    1. Column (.wrl, .x3d)
    2. Head Up Display, up-down-value script (.wrl, .x3d)
    3. Simple car (.wrl, .x3d)
    4. Slider Example with EXTERN proto .wrl, .x3d)
    5. Slider Geometry (.wrl, .x3d)
    6. Alternatives - using switch node (.wrl, .x3d)
    7. Star (.wrl, .x3d)
    8. Star proto.wrl, .x3d
    9. Key frame - animation of a sphere in cube (.wrl)
    10. Key frame - animation of sphere in a cube with colour change (.wrl)

Lecture summary

Here are the topics I intend to cover in the lectures. A good plan would be to look at these in the text book prior to the lecture. Here's a copy of my slides. I also plan to put up MPEG4 versions of the lectures.

Key points of the lectures:

  1. We started by looking at primitives and attributes within the Virtual Reality Modelling Language (VRML) (aka VRML97) and the Extensible 3D Graphics Language (X3D). We looked at basic shape nodes and their attributes, transform nodes and grouping.
  2. We looked at how to improve the readability and reuse of code with Inline, DEF/USE and especially PROTOs.
  3. We looked at animation. In particular, we covered Events and ROUTEs and useful nodes such as Sensors and Interpolators.

    We looked at how to place JavaScript code inside Script nodes, and how to use these for animation.

X3D and VRML Software

The Cortona VRML plug-in is installed on the Service machines. Although it has maybe a less friendly user interface than obsolete browsers such as CosmoPlayer, it is more forgiving of incorrect VRML (i.e. it does not crash the browser/system). There are versions for Windoze browsers such as IE etc and Safari on PowerPC MacOS X. If you have an Intel Mac, then running IE under Windows under the Parallels Desktop also works well. These VRML browsers are plugins to Firefox or Internet Explorer; click on a .wrl file to view the world, or drag-n-drop the .wrl file into the IE or Firefox browser.

The InstantPlayer x3d browser is also installed. Feedback welcomed, but it seems to run well on Windows or MacOS 10.5. If you use Sun's NetBeans IDE, then try the X3D-Edit tool, which provides nice editing support and a preview window. I've found the editor reliable and fairly intuitive, but the preview window to be pretty flakey on Windows, and not working on Linux or MacOS 10.5 (but I didn't try to fix it).

Other x3d/VRML tools

You may also wish to use a syntax checker such as vorlon.

I'd be interested to hear of any other plugins or browsers (especially for MacOS or Linux). There's a fairly comprehensive list on wikipedia.

The ones I have found for MacOS include

  • Cortona if you have a PowerPC Mac
  • FreeWRL works but not very well?
  • Octaga Player, which works on my Intel Mac for some scenes but crashes on others.

Other Linux viewers include

  • lookat and gtklookat (packages in the Ubuntu distribution or Debian unstable)

The White Dune VRML toolkit for Windows, MacOS and Linux has been suggested. Beware if you use a tool to generate x3d/VRML for the assessment that I get fussy about code quality.

Help with x3d/VRML

There are many resources for help with x3d/VRML.

  1. First ports of call are often the The Virtual Reality Modeling Language Specification which specifies VML nodes and fields, and provides examples, and the x3d site.
  2. The library has 3 useful books
    1. The VRML 2.0 Handbook, Jed Hartman & Jose Wernecke Addison Wesley, 1996
    2. VRML 2.0 Sourcebook, David Nadeua John Moreland, Wiley 1997
    3. X3D extensible 3D graphics for web authors, Don Britzman and Leonard Daly, Morgan Kaufman, 2007
  3. There are FAQs on the web
    1. http://www.cs.kent.ac.uk/archive/people/staff/jcr/webVRMLInfo.html
    2. http://home.hiwaay.net/~crispen/vrmlworks/faq/
    3. http://www.web3d.org/x3d/

VRML gallery

Our VRML gallery of some of the more interesting/amusing solutions to the last few years' VRML tasks. Thanks to all those who contributed.

School of Computing, University of Kent, Canterbury, Kent, CT2 7NF

Enquiries: +44 (0)1227 824180 or contact us.

Last Updated: 02/03/2011