Home Contents Forum Links Tip Jar
Animation Math in Lingo       

Rendering 3D in Director

There are several ways to render 3D in Director, with the best quality using the Shockwave 3D™ cast member. The other methods are used to show some of the math and programming behind 3D rendering, and come in handy in some situations.

Shockwave 3D™
The Shockwave 3D cast member provides a 3D hierarchy, resource geometry, and a polygon-based renderer. It supports the importing of 3D data from 3D modelling applications, and includes some animation functionality.

Rendering a 3D animation model using Shockwave 3D means setting sw3D properties based on model variables. This is relatively straightforward since sw3D properties are three-dimensional (as opposed to 2D sprite properties).

Since the Shockwave 3D cast member takes care of the math and programming involved in rendering 3D, less time is spent on it in this tutorial. The learning curve consists mainly in becoming proficient with the Shockwave 3D API and third-party modelling applications and plug-ins.

Rendering to Sprite Width, Height, and Location
This method can be used to make sprites appear to move in three dimensions, but not rotate in 3D. The rendering algorithm uses the 3D coordinates of each object to set sprite properties that give the depth cues of perspective, haze, and z-axis blocking. Those sprite properties are:

  • width and height for relative size
  • loch and locv for relative speed and position
  • color, blend and others for haze
  • locz for z-axis blocking

The Perspective & Other Depth Cues section shows how this type of rendering is done.

Rendering to the Sprite Quad Property
Moving as well as rotating a sprite in 3D can be done using the sprite quad property, which allows you to set the corners of a sprite to any four points. Rendering using the sprite quad property is discussed in The Quad Property. Quads can be combined to form solid geometries as shown in 3D World Hierarchy.

Rendering to an Image Object
The methods of Lingo's image object allow a ray-tracing renderer to be written in Lingo. It is slower than using Shockwave 3D, but can be used for some interesting effects. A demo of a simple ray-tracing renderer may be added to the tutorial in the future.

 
 


Copyright © 2003 JM Harward 
 jmckell~at~jmckell~dot~com
All lingo provided on this site may be used freely for educational purposes. Not for redistribution as uncompiled code. Instructional materials may not be reproduced without permission.