![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Cutting Edge Direct 3D Programming
Ray-tracingRay-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 isnt well suited for realtime graphics and is not supported by Direct3D. Figure 2.26 is a ray-traced image (produced with POV-Ray).
AnimationRealtime 3D graphics are no fun without animation. 3D animation can be accomplished in two ways: motion attributes and key-framing. Motion AttributesOne 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-FramingThe 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:
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. ConclusionAlthough 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, well introduce Direct3D. Well look at how Direct3D implements the common techniques, and how it differs from other graphics packages.
|
![]() |
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. |