Session 4B: VRML, Java, and Virtual
Reality
Eric Wernert, Sr. Scientist & Manager
UITS Advanced Visualization Lab, Indiana University
<ewernert@indiana.edu>
This session provides a brief introduction
to VRML, the Virtual Reality Modeling Language. We illustrate how
VRML can be used in conjunction with Java and describe the benefits of
incorporating VRML into a computer science curriculum. We
conclude with an introduction to virtual reality (VR) technologies and
the role that VRML and Java play in the development ov VR
applications. This session provides a basic background for the
subsequent demonstrations in the UITS
Advanced Visualization Lab during Session 5.
.
Outline
- VRML - What, When, Why, and Why Not
- VRML and Java
- Virtual Reality
- Resources
1. VRML - What, When, Why, and Why Not
VRML Description (from the ISO Specification)
The Virtual Reality Modeling Language
(VRML) is a file format for describing
interactive 3D objects and worlds. VRML is designed to be used on the
Internet,
intranets, and local client systems. VRML is also intended to be a
universal
interchange format for integrated 3D graphics and multimedia. VRML may
be
used in a variety of application areas such as engineering and
scientific
visualization, multimedia presentations, entertainment and educational
titles,
web pages, and shared virtual worlds.
VRML is capable of representing static
and animated dynamic 3D and multimedia
objects with hyperlinks to other media such as text, sounds, movies,
and
images. VRML browsers, as well as authoring tools for the creation of
VRML
files, are widely available for many different platforms.
VRML supports an extensibility model that
allows new dynamic 3D objects
to be defined allowing application communities to develop interoperable
extensions to the base standard. There are mappings between VRML
objects
and commonly used 3D application programmer interface (API) features.
Brief History of VRML
1994 -
VRML1.0 standard based on SGI's Open Inventor - static models only
1997 - VRML2.0 standard
(officially VRML97) based on "Moving Worlds" proposal - dynamic models
and extensibility
2003 - X3D standard
(eXtensible 3D, "VRML3.0") - clarification and modularization
of VRML 97 + expanded capabilities
-- We'll be refering to the VRML97
standard in these notes.
VRML Examples
-
Note: VRML examples require the installation of a VRML browser (Web
plugin) - see e.g. Cortona
Benefits of VRML for teaching Computer Science
- Open Standard
- refined be the collective wisdom of expert user community
- Widely
supported - static file VRML file import and export in most 3D
packages and visualization tools
- ASCII
encoding -> many possible developer interfaces
- GUI Editors
- Text Editors
- Translation programs (Java or Perl)
- combinations of the above
- Motivating -
3D graphics, audio, media files; immediate feedback; visual debugging
- Gradual
exposure to programming - modeling -> animation ->
interaction -> scripting -> programming
- Object-Oriented
concepts - objects (nodes), fields, input/output interfaces
(routes), abstraction and inheritence (protos), etc.
- Other
applied concepts - data structures (trees, stacks, etc), 3D
math, linear algebra, etc.
- Lots of
resources - content components, examples, tutorials, and tools
Why not use VRML?
- Relatively complex standard - lots of features and functionality
- Lacks comprehensive debugging tools
- May not scale well to complex problems - becomes very "kludgey"
for certain types of applications
- Event and execution model is less explicit than procedural
languages
- Fewer robust tools outside of MS Windows
- Evolving standard
- competing, proporietary technologies are quicker with new
features
2. VRML and Java
VRML Scene Graph Structure
More than just objects, appearances, and transformations
- Interpolators vary
position, orientation, color, shapes, etc. over time
- Sensors detect and
respond to user actions and control timers
- Node outputs may be ROUTEd
to node inputs creating explicit chains of events
- special working group extensions for GIS (GeoVRML), humanoid
animation (H-ANIM), MPEG4, etc.
Programming VRML with Java - 3 Possible methods:
- VRML Script Node
- JavaScript/VRMLscript/ECMAscript - interpreted at runtime
- Java - precompiled classes
- both methods (Java/VRML/ECMAScript & Java) are supported in
most commercial browsers
- examples: simple
orrery, animation
with playback control
- VRML EAI (External Authoring
Interface)
- Java classes for interacting with the VRML browser from an
external Java applet
- powerful, but requires the right combination of Web browser,
VRML browser, and Java
- example - astronomy
visualization tool (screen shot)
- VRML implemented (in whole or in part)
within another programming environment
- VRML loader for Java3D
- VRML classes in Java, C++, and other scene graph libraries
- usually no execution model -> developer must implement that
in the native language
Programming X3D with Java - promises more possibilities
- lightweight X3D viewers in Java only
- full X3D browsers written in Java3D - www.xj3d.org
3. Virtual Reality
Characteristics of a VR system
- immersive - wide field of view -> wide screen or head-mounted
display
- stereographic
- interactive
- first person perspective -> head tracking
- natural interaction -> hand/body tracking
- multi-modal - visual + audio, haptic
VR Displays
So, VRML is ideal for VR displays, right?
- Not really.
- VRML is great as a rapid prototyping tool, but issues with device
drivers, multi-processing, and synchronization make it cumbersome for
more complex applications and VR.
- A few successful VRML-based tools:
- CAVE6U browser for CAVEs - covers ~ 90% of the standard
- VRML97 is the basis for haptics API from Reachin, Inc.
So, how do people program for VR?
- OpenGL + C + VR Library
- OpenPerformer (visual simulation scene graph library) + C++
- YG (scripting language built on top of Performer)
- Java3D - with many custom extensions (U. of Calgary)
VR Demos:
- Crayoland - simple VR
environment using OpenGL - audio, animation, interaction
- 3DIVE - scientific
visualization application - natural interaction, volume rendering
- Mission to MIR - VRML
content in CAVE6U browser - "Gorby" visit in `97
- Reachin Haptic Display -
simple environments coupling graphics with force feedback - VRML-based
API
4. Resources
Eric Wernert, UITS Advanced
Visualization Lab, Indiana University
Last Modified November 5, 2004