Game Development Reference
In-Depth Information
Chapter 15
Picking
Figure 15.1:
The user picking
the teapot
Suppose that the user clicked the screen point s =( x , y ). From Figure
15.1 we can see that the user has picked the teapot. However, the appli-
cation cannot immediately determine that the teapot was picked given
just s . Therefore, we must come up with a technique to calculate this.
We call this technique picking .
One thing that we know about the teapot and its relationship with s
is that the teapot was projected to the area surrounding s . More cor-
rectly, it was projected to the area surrounding the point p on the
projection window that corresponds to the screen point s . Since this
problem relies on the relationship between a 3D object and its projec-
tion, we gain some insights by examining Figure 15.2.
257
Search WWH ::




Custom Search