Graphics Reference
In-Depth Information
M t
- SceneNode
Trophy
M s
Shusui
Mesh
M xf
Cylinder
Mesh
Plane
Cylinder
Figure 16.15.
Scene graph and orientation in 3D.
Approach. Implement a simple two-level hierarchy and compute the or-
thonormal basis for the leaf node to verify the position and orientation.
Figure 16.16 is a screenshot of running Tutorial 16.7. At the center of the appli-
cation is the “Plane Trophy” object, a green plane on a red cylinder stick. Fig-
ure 16.15 shows the two-level scene node hierarchy of the “Plane Trophy” object.
We see that the green plane ( shusui ) and the cylindrical base are siblings, both
children of the trophy base. In this case, the M t transform of the Plane Trophy
node and the M s transform of the shusui node are designed to be manipulated
by the user, whereas the M xf transformation of the cylinder node is designed to
scale and place the cylindrical mesh in the proper initial position.
Click on the “Compute Ref Axis” checkbox to observe that the orthonormal
basis drawn at the top of vertical tail wing and a sphere continuously travel from
the center toward the front of the plane. Now select and manipulate the transforms
of the Plane Trophy ( M t )and shusui ( M s ) nodes. Notice that the orthonormal
basis drawn at the vertical tail wing always maintains its relative position and the
sphere always maintains its relative traveling direction. This functionality can be
supported by computing the proper orthonormal basis of the shusui child node.
Figure 16.16.
Tutorial
16.7.
Matrix M xf . Recall from the
discussion in Tutorial 16.6 that
the transformation M xf in Fig-
ure 16.17 is defined to trans-
form the cylinder mesh to the
proper component location.
As illustrated in Figure 16.17, a straightforward approach to compute the gen-
eral transformation of an orthonormal basis is by identifying and tracking the
transformation of the three anchoring positions, where
P o
=(
0
,
0
,
0
) ,
P y
=(
0
,
1
,
0
) ,
P z
=(
0
,
0
,
1
) .
In our case, we have a general transformation operator ( M ) that is the concatena-
tion of the parent trophy ( M t ) and the child shusui ( M s ) transforms,
M
=
M s M t ,
 
Search WWH ::




Custom Search