Exercise 11 — View a 3D World


In this exercise, you put a 3D world in a title and use a 3D Window module to view its contents.

Applet

The airplane model is of an A-10 Warthog jet. It was created by Viewpoint Data Labs, and is used by Kinetix with permission.

Instructions
To see a camera view: Click Camera1 or Camera2.
To play the animation: Click the airplane.
To move around the 3D world: Drag in the 3D window.

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 this 3D exercises. If this applet does not run, you can try using a different browser, or you can skip this exercise for the time being.

See 3D Worlds and Hyperwire for more information about 3D navigation modes.

Hyperwire treats a 3D world much like an external media file. In this exercise, the 3D world is saved in a .wrl file, which is encoded in VRML or VRML+3DS. VRML is the current standard Web format for encoding 3D worlds. VRML+3DS, created at Autodesk and Kinetix, is a set of extensions to VRML that add behavior and animation to the 3D world. Both formats use the .wrl extension. If a player that reads standard VRML encounters VRML+3DS code in the file, it simply ignores it.

The 3D world is inhabited by 3D mesh objects, lights, and cameras. You don't create the 3D world in Hyperwire. You can create it by using 3D Studio MAX, AutoCAD, or a VRML editor.

If 3D Studio MAX is installed on your system, also see Exercise 19, Creating a 3D world. Exercise 19 is for 3D Studio MAX users. It shows how to create and animate the 3D world you view in this exercise.

To view a 3D world in a Hyperwire title, you add a 3D World module to the title, and then associate it with the .wrl file.


Open the title and add a 3D world to it:
  1. In Hyperwire, open the file Exercises\Ex11Work\Jet.Ttl.

    This file has been prepared to save you the trouble of setting up the background and buttons.

  2. Drag a 3D World module from the Module panel to the Wire view.

    The 3D World module's Properties dialog appears.

  3. Click the file button to open a file dialog. Choose the file A-10.wrl in the \Ex11Media subdirectory, and then click OK.

    A list of objects in the 3D world appears in the Properties dialog beneath the label, Create 3D Modules. A preview window also appears, showing a view of the 3D world.

    In this case, the 3D world contains some walls and a model of a jet airplane.



    Don't close the Properties dialog yet.

When you first add a VRML world to a Hyperwire title, its ambient light defaults to black. This can make the scene too dark unless you adjust ambient lighting, as in the following steps.


Adjust the ambient light:
  1. Go to the Ambient Light panel.

  2. Click the Color button to display the Color Editor, change the color of ambient light to white, and then click OK.

    Other colors of ambient light tint the scene.

  3. Change the Intensity value to 0.55, and make sure the Initially On check box is turned on.

    The best Intensity value varies from scene to scene.

  4. Go back to the main 3D World module panel. Don't close the Properties dialog yet.

Adding a 3D World module without selecting individual objects within it, still lets your title display the mesh objects within the 3D world. As you can see from the Create 3D Modules list, you can also choose to add individual objects within the 3D world as Hyperwire modules. In general, adding all 3D objects individually would make your title extremely crowded and complicated, and you don't want to add individual objects as modules unless you have a special use for them above and beyond viewing the 3D world. The following steps show how to use two Camera modules in this way.

This exercise uses the views defined by the two cameras within the A-10 world. You add these cameras as Hyperwire modules, but leave the rest of the world's contents alone.


Add the two cameras along with the 3D world:
  1. Choose Camera from the List Objects drop-down list.

    The Create 3D Modules list changes to show the names of the cameras in the 3D world.

  2. In the Create 3D Modules list, click Camera01, and then CTRL+click Camera02 to add it to the selection.

    The two camera names should be highlighted.

  3. Click the Add button beneath the list.

    This adds the two cameras to the list of objects that will be added as Hyperwire modules. A check mark should appear next to the name of each camera.



  4. Click OK to accept this selection and close the Properties dialog.

    Hyperwire displays a further dialog, described in the following steps.

When you click OK to close the 3D world's Properties dialog, a dialog labeled 3D World, and captioned, Create a view of the 3D world? appears.



A 3D World module must be associated with a 3D window or a 3D view for its contents to be visible in the Hyperwire title. Hyperwire prompts you to create the window or view whenever you add a 3D world to your title.

As the dialog explains, a 3D Window and a 3D View module are almost alike. Both provide a view onto a 3D world. The 3D window is slightly more limited in capability and more efficient in performance. In this exercise, you don't need the additional capabilities of a 3D View module.


Choose how to view the 3D world:

If you choose not to create the view or window at 3D world creation time, you can later add a view or window module to your title, but then you must explicitly associate the view or window with the 3D world, using the view or window's Properties dialog. The view or window that you create by using the Create a view ...? dialog is automatically associated with the 3D world you just added.


Position the view onto the 3D world:

The A-10.wrl file you just added is a VRML+3DS file. It contains an animation created using 3D Studio MAX. 3D World modules have an input port that tells them to play their animation, provided this VRML+3DS information is present in the .wrl file.

You will wire the title so that clicking the 3D window causes the animation to begin playing.


Wire the 3D window so it plays the animation:
  1. Wire the 3D A-10 window's Button Up output port to the A-10 3D World module's Animate All input port (More/Animate/Animate All).

    The wire requires one parameter, a frame number.

  2. Double-click the wire (not its "not" symbol) to display the Wire editor. Make the frame number a constant value, and set it to equal 0 (zero).

    Frame 0 is the default beginning frame for 3D Studio MAX animations.

Now, wire the two buttons so each displays its corresponding camera view.


Wire the buttons so they display the camera views:
  1. Wire the Camera1 button's Button Up output port to the A-10 window's Set View to Camera input port (More/View/Set View to Camera).



    As you can see from the "not" symbols, this wire has two undefined parameters. One is the frame number, as for the wire that starts the animation. The other is for the name of the camera to use.

    The camera name parameter is the reason you needed to load the cameras as Hyperwire modules of their own.

  2. Click one of the "not" symbols, and choose camera name from the pop-up menu.

    A wire appears. Drag this wire to connect it to the Get Camera Name input port of the Camera01 module.



    Notice that you don't need to specify or even know what the camera name is. (In fact, it's Camera01.) This wire obtains the name from the camera module, making it available to the 3D Window module.

  3. In the Wire editor, click the Frames parameter to highlight it, and then choose the Constant radio button. Set the frame number value to 0.

    If you previously closed the Wire editor, double-click the wire, but not its "not" parameter symbol, to display the Wire editor again.

    Caution: If you click Constant in the Wire editor while the camera name parameter is highlighted, the Wire editor changes its type to 'a string', which is the only way to specify a constant name. To fix this immediately, choose Edit/Undo. To fix it at a later point, you can delete the wire and start over, or you can use the Wire editor to correct the problem by following these steps:

  4. Repeat steps 1 through 3 to wire the Camera2 button to the A-10 window, designating the Camera02 object as the source of the camera name.

Run the title to test it.

In the example at the start of this exercise, the animation plays only when you click the airplane itself. To add this capability, you treat the airplane as a Hyperwire module, as you already do the two cameras.


Add a 3D Mesh module to represent the airplane:
  1. Add a 3D Mesh module to the title.

    The 3D Mesh module's Properties dialog associates the mesh with the A-10 world by default, because it is the only 3D World in your title.

  2. In the Properties dialog, select Jet_Body from the Mesh Name drop-down list, and then click OK.

  3. Detach the wire from the 3D Window module's Button Up output port. Drag it to the new 3D Mesh module, and reconnect it to the Button Up output port of the 3D Mesh that represents the Jet_Body airplane model.

    Now to run the animation, you must click the airplane. Clicking other parts of the 3D Window has no effect.

Run the title to test it, and then save your work.

This is the end of exercise 11. Exercise 12 shows how to use hotspots on a map of a 3D world to assist the user in navigating it.

Home | Previous | Next