Graphics Reference
In-Depth Information
that as the arrow having arrived at the tiger and return. The code under label D is
similar to that of Listing 16.18, where we compute the interpolated rotation q new
to align the arrow front direction toward the tiger.
16.4
Simple Scene Graph in 3D
Everything we learned about scene nodes and scene graphs generalize to 3D space
in a straightforward manner. In this section, we use a simple example to refresh
and verify our knowledge from Chapter 11.
Tutorial 16.6.
Project Name:
D3D _ SimpleHierarchy
Library Support:
UWB _ MFC _ Lib1
UWB _ D3D _ Lib17
Tutorial 16.6. Scene Node and Scene Graph in 3D
Goal. Demonstrate that the hierarchical modeling and transformation con-
cepts that we learned from 2D apply in a straightforward manner in 3D.
Approach. Build a simple two-level hierarchy of scene nodes in 3D and
demonstrate that all UI transformation applies in an intuitive manner.
Figure 16.14 is a screenshot of running Tutorial 16.6. Figure 16.13 shows that the
center object in this tutorial is organized by a simple scene tree hierarchy. On the
right of the figure, notice that:
Figure 16.14.
Tutorial
16.6.
1. The Base node is the root of the hierarchy. The M 1 transform of the
Base node controls the entire scene tree hierarchy. In this case, we want
Y
- SceneNode
M 1
M xf2
Base
Y
Cone
Mesh
M 2
M xf1
Cylinder
Mesh
X
To p
Z
Cylinder
M 2
M xf1
M xf2
Cone
Mesh
Y
M 1
Cylinder
Mesh
Cone
X
X
Z
Z
Figure 16.13.
Building a simple scene graph in 3D.
 
Search WWH ::




Custom Search