3D Worlds and Hyperwire


A 3D world is a three-dimensional scene. The scene can be represented by a VRML document (.wrl, .wrz, or .wrl.gz), a 3D Studio (.3ds) scene, or a 3D AutoCAD drawing saved in DXF format (.dxf). A 3D world cannot be a 3D Studio MAX file (.max), but you can export a 3DS MAX scene to a .wrl file, as described in exercise 19. (You can also export a 3DS MAX scene as a .3ds file.)

A 3D world contains 3D mesh objects, lights, and cameras. The mesh objects are the geometry that you see when you view the world. The lights illuminate it, and cameras define views of the world. (Lights and cameras are optional—see Creating 3D Worlds in 3D Studio MAX.)

Hyperwire displays a 3D world interactively. You can move around within the world by navigating the world.

The following applet shows a 3D world. The instructions below summarize the navigation modes used to move within the world and view its objects from different angles.

Applet

Instructions
To move around the 3D world: Drag in the 3D view.

The default navigation mode is Dolly & Pan mode.
To change the navigation mode, hold down a modifier key while you drag.

Hold down CTRL to move along the plane of the screen in Truck & Pedestal mode.

Hold down SHIFT to circle the viewpoint in Pitch & Roll mode.

Hold down ALT to circle the viewpoint in Orbit mode.

(You can also right-click the 3D world to display a pop-up menu that lets you choose the navigation mode.)

Note: The Hyperwire 3D package is still in the beta stage, and does not work correctly in all browsers. If the applet shown on this page runs correctly, then probably you will be able to do the 3D exercises. If this applet does not run, you can try using a different browser, or you can skip the 3D exercises for the time being. 3D worlds are not supported for Netscape Navigator versions prior to 3.0, or for Internet Explorer versions prior to 3.0.

Part of the strength of Hyperwire is that it lets you combine 2D graphics and user-interface widgets with a 3D world. Exercise 11 and exercise 12 demonstrate how controls in a title's interface can enhance the standard ways of navigating a 3D world.

Tip: Using only the default navigation modes, which provide six degrees of freedom, it is easy to get lost in a 3D world. Provide navigation aids like the ones demonstrated in the exercises to help the end user navigate the world.

In a Hyperwire title, the 3D world is represented by a 3D World module. The module specifies the 3D world file, just as an Image module specifies a 2D graphic file. To display the 3D world, you need an additional module, either a 3D View or 3D Window module.

You can associate an object in the 3D world—a mesh object, a camera, or a light—with a particular Hyperwire action by using a module to represent that object in Wire view. If the object must be part of the scene but doesn't need to be linked to a Hyperwire action, you don't need to represent it with a module.

For example, the Hyperwire title you build in exercise 11 has two 3D Camera modules so the user can push a button to choose a camera view.


Animation and Behavior

To create a 3D world, you use an application such as 3D Studio MAX from Kinetix, AutoCAD, or a VRML editor. One advantage of using 3DS MAX to create a 3D world, is that the world can contain animation and behavior. VRML+3DS lets you add keyframe animation to a 3D world. It also lets you associate a mesh object with a trigger that starts or stops an animation, jumps to a different view of the scene, or jumps to a different URL.

You can also use Hyperwire to associate a mesh with a trigger. Create a 3D Mesh module for the mesh object, and then use the 3D mesh's Properties dialog to set up the trigger. Exercise 13 shows how to do this.

The following applet also uses triggers: approaching the bottom or the top of the stairs triggers an animation that takes you upstairs or downstairs. To try it, dolly and pan from the initial view to the bottom of the stairs.

Applet

VRBL (VRML+3DS) files have the .wrl extension as regular VRML files do. The animation keys and trigger data are saved in an appended section. VRML players that don't support VRBL simply ignore this section. They correctly display the 3D world saved in the file, but the animation and behavior don't appear.

Note: The original VRML standard, VRML 1.0, has no support for animation and only limited support for behavior. The newer standard, VRML 2.0, more fully supports animation and behavior. Because VRML 2.0 is new, players for VRML 2.0 are still being developed. VRBL (also known as VRML+3DS) is a solution created by Kinetix. It is compatible with VRML 1.0 but adds animation and simple behaviors compatible with 3D Studio MAX. Hyperwire 3D World modules support VRML 1.0, VRBL (VRML+3DS), .3ds, and .dxf files. 3D World modules also support geometry, lights, and cameras from VRML 2.0 files, but do not support VRML 2.0 animation and behavior. 3DS MAX can export a world to either VRML 1.0 or 2.0.


Creating a 3D World with 3D Studio MAX

As exercise 19 demonstrates, you can create a 3D world using 3D Studio MAX. Exercise 19 shows how to use 3DS MAX to create the keyframe animation for the 3D world that the exercise 11 title displays. Hyperwire does not read 3DS MAX (.max) files, but you can use 3DS MAX to create a VRML or VRBL (.wrl) file, or a .3ds file.

This section provides some suggestions for creating a 3D world that will work well interactively, especially when viewed over the Web.

Except where they concern animation, these suggestions also apply in general to using a different VRML editor, but this section uses 3DS MAX terminology. See the online Help file for the VRML Export plug-in for full information about creating 3D worlds for Web viewing.

If you are used to using 3DS MAX to create detailed renderings, interactive 3D worlds will probably look primitive to you. For a 3D world to be interactive and to display efficiently, especially on the Web, it must be relatively compact and simple. Current hardware and software technology impose these limitations. Because you want your work to look as good as possible and also to display and animate quickly, you need to be aware of these limitations and be prepared to work with them.

Low Polygon Models:

Keep the polygon count of your objects low for good performance. A complete scene with a maximum of 5000 to 10,000 polygons is manageable for most systems.

Kinds of Animation:

When you create a VRBL (VRML+3DS) file, the 3DS MAX VRML plug-in exports transform animation (move, rotate, and scale), hide-track animation, and color animation for lights, but not other kinds of animation.

For example, in 3DS MAX, you can animate modifiers such as Taper and Bend and you can animate object parameters, such as increasing or decreasing the radius of a sphere. However, you cannot export this kind of animation to a .wrl file. Such animation is ignored and the animated objects are displayed as they appear at frame 0.

VRML 2.0 export supports all types of animation, but this will not be visible in a Hyperwire 3D World module.

Use TCB Controllers:

Always use TCB (Tension, Continuity, Bias) animation controllers to generate the smallest possible file size. Other kinds of controllers, such as the default Bezier controller, export animation keys on every frame. This increases the file size and reduces playback performance.

Limited Material Support:

VRML supports only standard and multi/sub-object materials, and recognizes only the following material components:

Ambient color
Diffuse color
Specular color
Shininess
Opacity
Diffuse texture map.

A standard material exported to VRML can use only one Diffuse Texture map. Multi/sub-object materials can't use texture maps.

Lights and Cameras

Both lights and cameras are optional in the 3D world.

If no light is present, 3DS MAX provides the default lighting that the 3DS MAX renderer uses. VRML supports all four kinds of 3DS MAX light objects: Omni, Target Spot, Free Spot, and Directional.

If no camera is present, the default initial view of the world is from the top, centered on the geometry. Unless you want the user to begin navigating the world from this position, create at least one camera view of the 3D scene.


VRML Compression

If you use VRML files for your 3D worlds, you can improve performance for the end user by compressing your VRML files with GZIP. GZIP is a compression/decompression program developed by the Free Software Foundation's Project Gnu. GZIP reduces the size of VRML files by up to 70 percent, speeding up download time over the Net.

Hyperwire can read and decompress GZIPped VRML files (.wrz, .wrl.gz, *._wrl.gz). Compress the VRML file before you include it in your title. A Hyperwire title on a Web site loads the compressed VRML file. The Hyperwire 3D runtime classes decompress it and display it.

The latest version of GZIP is always available at:

   ftp://prep.ai.mit.edu:/pub/gnu

Currently the PC version is called gzip-1.2.4.msdos.exe.

GZIP is also available at other sites such as http://fractal.mta.ca/cnam/astro/gzip-e.html.

Home | Previous | Next