Graphics Reference
In-Depth Information
that must be performed (
), and we use the cross product to determine if
we should turn left or right.
θ
4. Gradual effect. Instead of setting the transformation operator with the
computed final value, we update the operator with a fraction of the com-
puted value. In this way, subsequent updates will gradually transform our
object toward the ultimate goal.
Tutorial 12.2.
Project Name:
D3D _ SceneNodeOrient
Library Support:
UWB_MFC_Lib1
UWB_D3D_Lib12
Tutorial 12.2. Automatic Navigation with Independent Aiming
Goal. Demonstrate and understand that the lessons learned from Tuto-
rial 12.1 can be applied to individual scene nodes in a scene graph.
Approach. Building on Tutorial 12.1, implement a second target position
for aligning the palm component.
Figure 12.5 is a screenshot of running Tutorial 12.2. Once again checking the
“Allow Arm Movement” checkbox will enable the navigation of the arm object. In
addition to the left mouse button controlled gray target, in this tutorial right mouse
button drag controls the position of the red target position. Similar to the previous
tutorial, the arm object will automatically navigate toward the gray target. In this
tutorial, as the arm object travels, its palm component will continuously point
toward the red target.
In Figure 12.2, the origin position of the palm component is located at p o p ,
whereas the front is also defined by p o f . For the palm component, the OC-to-WC
transformation is defined by the concatenation of the palm transform ( M p )and
the arm transform ( M a ), so
Figure 12.5.
Tutorial
12.2.
p r wc
p wc
f
p oc
f
=
M p M a ,
(12.2)
V p wc
p wc
p o p M p M a
=
.
p
V f wc
V r wc
α
As depicted in Figure 12.6, in this case the front-facing vector of the palm object
is
p t wc
V t wc
V wc
p
p wc
f
p wc
p
=
.
p wc
p wc
p f wc
If the red target's WC position is defined to be p r , then the vector from the palm
object toward the red target is
Figure 12.6. Imple-
menting the aiming func-
tionality.
V wc
r
p wc
r
p wc
p
=
.
 
 
 
 
Search WWH ::




Custom Search