Graphics Reference
In-Depth Information
With this new scene graph, we have a caravan that is extremely scalable. No
matter how many camels we place in this caravan, the number of joint transforms
requiring manipulation for the animation of the legs is constant. By manipulat-
ing just four hip joints and two knee joints, the entire caravan's leg motion will be
affected. Of course, this scalability comes at a cost: the uncanny and unnatural per-
fect synchronization of the entire caravan. At a distance, this type of low-fidelity
caravan might be perfectly adequate, but if a bit more variety is desired, we could
choose to have a handful of different limb animation sequences, create a distinct
reusable camel “stencil” for each such sequence, and have each camel in the cara-
van be an instance of one of the stencils, chosen at random. Without much loss in
scalability, we could thus achieve animation that is not quite so unnatural.
Of course, our caravan needs to be moving across the desert too; otherwise, the
leg motions will look awfully silly. Thus, our animation logic must perform time-
based manipulation of instance transforms on the camel objects simultaneously
with the manipulation of the joint transforms.
Inline Exercise 6.15: How can we make the caravan's movement across the
desert scalable? Is there a scene graph that would allow a single instance trans-
form to move the entire caravan, without the loss of the scalable knee/hip con-
trol we just designed? What loss in realism would occur with such a plan?
If you are interested in knowing more about how to implement reusable com-
ponents in XAML and WPF, consult the online materials for this chapter.
WPF is, of course, just one of many scene-graph platforms, and all implement
reusability as part of their support for controlling scene complexity. For more
information on scene-graph platforms, see Chapter 16.
6.7 Discussion
We have demonstrated the techniques common to most real-time fixed-function
3D platforms that are useful for displaying simple scenes composed of triangle-
mesh objects, covered with solid or texture-mapped materials, and rendered using
the classic Phong reflectance model with interpolated or flat shading.
Our focus on WPF as the example platform is designed to allow you to exper-
iment and build prototype scenes using XAML, so you can exercise these tech-
niques without the need to work with a procedural language and compile/build
cycles.
It is important to note that a platform-resident scene graph is only applicable
to projects for which “the picture is the thing.” For most nontrivial applications,
where the image is meant to be a visualization of some application data, there is an
application model (database) storing both geometric and nongeometric informa-
tion, acting as the source fromwhich a scene graph is derived for display purposes.
This topic is discussed more extensively in Chapter 16.
 
 
 
Search WWH ::




Custom Search