Graphics Reference
In-Depth Information
In our case, the SceneNode:: Draw() routine computes and loads these trans-
formation matrices into the WORLD matrix processor before the corresponding
primitives are drawn. In the rest of this section, we will discuss issues concerning
selection and collision in the presence of OC spaces.
11.4.1
Mouse-Click Selection
In many graphical applications, it is often necessary for the user to select, or
activate, an individual component/object for special processing. For example, se-
lecting the left arm of Tutorial 11.6 for transformation. The selection process
is highly application-specific. For example, we can implement a pre-defined se-
lection scheme where the user selects components by typing specific characters,
or as in Tutorial 11.6 where the user selects components via a custom GUI in-
terface (the SceneTreeControl ). In addition, the results of selection are also
application-dependent. For example, the user can select an entire graphical object
(e.g., the human model), a component in the object (e.g., the left palm), or an
individual primitive of a component (e.g., the C p 0 circle).
An intuitive way for the user to select an object is by moving and clicking the
mouse over an object. To support this functionality, we must process every object
in the scene hierarchy to determine if the object is sufficiently close to the mouse-
click position. For example, the mouse-click position pt dc of Figure 11.19 should
select the left palm or the C p 0 circle. From this example, we see that to support
(M lp M la M b ) -1
M w2n
WC
Window
C p0
NDC
pt lp
R p1
(M la M b ) -1
OC of
Left Palm
Internal
To D3D
R a1
M d2w
DC
pt la
R a0
(M b ) -1
R a2
OC of
Left Arm
R b1
C b0
pt b
pt wc
pt dc
User
mouse click in DC
OC o f
Body
Transformed
mouse click in WC
Figure 11.19.
Mouse-click position in different OC spaces.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search