Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Cutting Edge Direct 3D Programming
(Publisher: The Coriolis Group)
Author(s): Stan Trujillo
ISBN: 1576100502
Publication Date: 11/01/96

Bookmark It

Search this book:
 
Previous Table of Contents Next


Ray-tracing

Ray-tracing produces the most realistic output of any rendering method. In fact, ray-tracing is known for its photo-realistic and even hyper-realistic output. Ray-tracing uses an entirely different approach than the methods we have discussed. The ray-tracing algorithm automatically calculates shadows, reflection, and refraction (other rendering methods do not automatically perform the calculations). Unfortunately, ray-tracing is notoriously slow. Single images can take hours or even days to calculate. Needless to say, ray-tracing isn’t well suited for realtime graphics and is not supported by Direct3D. Figure 2.26 is a ray-traced image (produced with POV-Ray).


Figure 2.26  A ray-traced scene.

Animation

Realtime 3D graphics are no fun without animation. 3D animation can be accomplished in two ways: motion attributes and key-framing.

Motion Attributes

One of the simplest ways to achieve animation is with motion attributes. A motion attribute is a translation, rotation, or scale factor that is applied to an object or set of objects for each screen update. Motion attributes are useful for simple repeating motions. Once a motion attribute is assigned to an object, the object will move according to the attributes, without any further intervention.

Key-Framing

The term key-framing comes from a traditional animation technique where only certain “key” frames in an animation are drawn. The remaining frames are produced by creating intermediate poses between the key frames.

Key-framing in 3D graphics means that you define the positions of objects in a scene at key times in an animation. The computer holds the responsibility of placing the objects in the remaining frames.

Key-framing requires you to determine the number of frames in an animation and to define keys at specific frames. For example, if you wanted to create an animation where an object travels from the top-left corner of the screen to the top-right corner and then to the bottom-right corner of the screen, you would perform the following steps:

1.  Define the number of frames in the animation (we’ll use 30 for this example).
2.  Specify that in frame 1 the object should appear at the top-left corner of the screen.
3.  Specify that in frame 15 the object should appear at the top-right corner of the screen.
4.  Specify that in frame 30 the object should appear at the bottom-right corner of the screen.

In Direct3D there are two modes for key-framing: linear and spline-based. Linear key-framing means the animation motion between key frames is linear; the objects travel the shortest path between key frames. Spline-based animation uses curved paths to travel between key frames.

Using our example, linear animation would cause the object to travel directly from the top-left corner of the screen to the top-right. At frame 15 (when the object reaches the top-right corner) the object will turn abruptly and travel to the bottom-right corner. A spline-base animation would cause the object to round-out the corner at frame 15. The object would act as if it was anticipating the fact that it was going to have to make the corner.

In both linear and spline-based animation, the objects in the scene are exactly where you specify at the key frames.

Conclusion

Although graphics packages vary from one to another, there is usually a body of concepts and terms that they have in common. The concepts and terms in this chapter are fairly universal and apply to most graphics systems. In the next chapter, we’ll introduce Direct3D. We’ll look at how Direct3D implements the common techniques, and how it differs from other graphics packages.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.