Next: 4. Mixing HTML with
Up: 3. Good VRML Style
Previous: 3.2 Levels of Details
3.3 Good VRML style and performance
Now you should have most elements for writing simple VRML scenes.
For the sake of mastering complexity (and also efficiency) it
is important to master the following techniques:
- 1.
- Grouping:
A lot of nodes do
=>Grouping.
Grouping so far encountered was mostly done with
the
=>Transform
node.
If you just want to put a series of objects into a group (without
any transformation, just use the
=>Group
node.
It is important to group objects together that can be viewed from
the major angles that users are likely to use (culling effect).
This way your browser won't need to render hidden objects.
- 2.
- Naming:
Each object can be given a name with
``DEF''. In this case it can reused with ``USE''
(see
=>Instancing) and
look again at the examples in section
2.1 on page .
- 3.
- Once your objects get more complex and you want to parameterize
you should master the =>PROTO node.
Note that you can do much more than we have introduced in this
section above.
- 4.
- Efficiency is major concern (at least today). Grouping and using
instances (DEFs) already will improve the rendering of a scene.
In addition when building
more complex scenes make use of the following techniques:
- =>LOD nodes. See section 3.2 again if needed.
- Overlapping:
Drawing objects that overlap are more expensive to render than adjacent
objects. At least when creating complex objects, remember this.
Per default, all objects are drawn off the center of the current
origin in all directions. E.g. if we draw a simple cube around
the [0 0 0] point: We draw 1 to the left and 1 to the right,
1 up/down and 1 forward/backwards leading to a 2 by 2 cube.
- Use =>Inlines
(preferrably with bounding boxes). This will
allow people to start navigating while details are still being loaded.
It works like the ``IMG height=xx width=yy'' tag in HTML.
- For people who don't like to ``waste'' their time with navigation you
might want to build tour guides as shown above. Note that later you
will learn how to make ``jumps'' more interesting with scripting
techniques.
Further reading: Chapter 10 of [Hartman et Wernecke, 1996].
Next: 4. Mixing HTML with
Up: 3. Good VRML Style
Previous: 3.2 Levels of Details
D.K.S. -
1998-03-18