Graphics Reference
In-Depth Information
V f wc
FrontDir
zDir has
-ve z value
p t wc
p f wc
θ
p wc
Target
V t wc
Figure 12.4.
Compute turning direction.
Approach. Implement the home-in seeking operation to demonstrate how
to compute front and how to turn objects to the left and right.
Figure 12.1 is a screenshot of running Tutorial 12.1. We can enable navigation
of the arm object by checking the “Allow Arm Movements” checkbox. When
enabled, the arm object will move toward the gray target. We can relocate the
target by left mouse button dragging in the drawing area. Observe that the arm
object always turns toward the target while continuously moving toward the tar-
get. The arm object will stop moving when its origin overlaps the target position.
The arm object always seeks out and homes in on the target position. Figure 12.2
Figure 12.1.
Tutorial
12.1.
oc
P o = (0, 0, 0)
oc
P f = (5, 0, 0)
shows the details of the arm object and the origin ( p o o ) and front ( p o f ) positions
defined for this tutorial. The scene graph design for the arm object is shown in
Figure 12.3. Recall that the M a matrix is responsible for transforming points in
arm OC space to the WC:
oc
P p = (3, 0, 0)
Figure 12.2. The front
of the arm object (from Tu-
torial 11.5, Figure 11.8 on
p. 308).
p wc
o
p o o M a ,
=
(12.1)
p wc
f
p oc
f
=
M a .
In this case, the front direction of the arm in WC is defined as
controls the
entire Arm
Arm
M a
V wc
f
p wc
f
p wc
o
=
.
controls
the Palm
In this way, “moving the arm forward” in the WC space can be implemented by
adding M a translation to the V wc
Palm
M p
vector. As shown in Figure 12.4, if we let the
f
target position in WC be p wc
t
, then the direction from the arm origin ( p w o )toward
the target is
Figure 12.3. The
arm with OC-to-WC trans-
forms (from Tutorial 11.5,
Figure 11.9 on p. 308).
V wc
t
p wc
t
p wc
o
=
,
where “turning the arm toward the target” can be implemented by decreasing the
θ
-angle in Figure 12.4 (the angle between vectors V wc
f
and V wc
). If we normalize
t
the vectors, then
Angle between vectors.
See
V wc
f
V wc
t
cos 1
Section B.2.1 for details.
θ =
(
·
) .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search