AN
INTRODUCTION
TO
VRML
VRML (Virtual Reality Modeling Language) is an open, extensible, industry-standard
scene description language for 3D scenes, or worlds, on the Internet. With VRML
and Netscape's Live3D, you can author and view distributed, interactive 3D worlds
that are rich with text, images, animation, sound, music, and even video.
VRML 1.0 supports worlds with relatively simple animations while VRML 2.0
(still in development) supports complex 3D animations, simulations, and behaviors
by allowing Java and JavaScript programmers to write scripts that act upon VRML
objects.
For detailed information about VRML, check out the
VRML Repository or our
Beginner's Guide to VRML.
CREATING
A VRML WORLD
There are three ways to create a VRML world:
- Create and edit a VRML text file by hand
- Use a conversion program
to convert an existing non-VRML 3D file to VRML
- Use an authoring package to create models and position them within a world
Because VRML is still a very new technology, chances are high that even if you use
an authoring tool or converter to create your VRML world, you will need to modify
it slightly by hand. Accordingly, it is helpful to familiarize yourself with the
basic VRML concepts and
syntax.
EMBEDDING
VRML INTO
YOUR
HTML DOCUMENT
Once you have created your VRML world, you can embed it within an HTML
document by using the <EMBED> tag. Using the <EMBED> tag to place a VRML
world in an HTML document is similar to using the <IMG> tag to place a 2-D
image in an HTML document. For example, the following example embeds a VRML file
called example.wrl into an HTML document:
<EMBED SRC="example.wrl" WIDTH=128 HEIGHT=128 BORDER=0 ALIGN=middle>
For more information about embedding, see Using The
Embed Tag.
VRML
TIPS AND
TECHNIQUES
There are many considerations important to the design and creation of VRML
worlds - some aesthetic, and some technical. Many factors that effect the
quality of HTML documents also apply to creating high-quality VRML worlds, such as
server and client system speed, transmission bandwidth, and browser compatibility.
By following these basic guidlines, your VRML worlds will be widely viewable, effective communicators, and easy to maintain.
Clarity
New media technologies provide innovative ways to communicate and
receive ideas. These methods' fresh perspectives are exciting for both
the designer and the audience. Communication remains the primary reason
for using any medium, old or new. So it is with VRML. To be used
effectively, VRML should not be treated simply as a novelty, but rather
as a new and powerful addition to the designer's palette.
Performance
Even the most enthusiastic user has limited patience for a slow Web page. This is
a key concern for VRML authors, since VRML is based on computation-intensive 3D
graphics and may incorporate other resource-intensive media. As with HTML
documents, download time is an important factor in VRML world creation. A
VRML world may require greater client system resources once downloaded. A fast
browser will offset this to some extent, but it's important to construct VRML
worlds efficiently. How you use the following elements will affect your Web page's performance.
- Polygons
Shapes in a VRML world are made of polygons. The
more complex a shape, the more polygons are required. A cube, for
example, is typically comprised of just twelve polygons, since each
side is made of two triangles. In contrast, a seemingly simple sphere
requires more than 200 triangular polygons. As more objects are added
to a world, the polygon count for that world increases. Each time a
user's viewpoint changes in the VRML world, the browser has to redraw
the scene. The more polygons the world contains, the longer the redraws
take. Therefore, low polygon counts are one way to increase the user's
navigation speed.
- Textures
VRML allows the textures to be mapped
onto shapes. Textures used in a VRML world may increase its size
considerably. This will affect both download and redraw times.
Therefore, if textures are used, small textures are desirable as one
way to keep download times low and navigation speed high. Also,
textures used in VRML worlds will require fewer client resources if
they use fewer colors.
- Instancing
Once defined, objects may be reused
in a VRML world. This technique can help to keep a world's file size
small. Once defined, an object can be used again, once or many times.
This technique is called instancing. Though there are some limitations
to instancing, its use can make your VRML code easier to write and
maintain, and your VRML worlds easier to download.
- Level of Detail
In the real world, as you get closer to an object, more details become visible.
Level of Detail (LOD) makes this possible in VRML worlds. The LOD node determines which
objects will be visible within defined ranges of coordinates within the VRML scene.
This permits both special effects and realistic simulations.
- Inlines
Other world files may be "pulled into" a world to help create a VRML scene. When
used this way, these files are called inlines. The WWWInline node is used to
refer to a world file to be included and, optionally, to display a bounding box
to show the user where the object, or objects, will be positioned before they are rendered.
- Compression
The larger the VRML world file, the
longer it takes to download. World files may be compressed, using
utilities such as GZIP. If a VRML browser recognizes the file type, it
can automatically parse the compressed file to display the VRML world.