Graphics Reference
In-Depth Information
user-interface techniques are really a part of the general topic of 3D interaction
(see Chapter 21, where we give actual implementations), but we discuss them
here because they are so closely related to the study of SO ( 3 ) .
Our standard 3D test program can display geometric objects modeled as
meshes. Imagine that we have a fixed mesh K with vertices P 0 , P 1 ,
, P k .We
can, before displaying the mesh K , apply a transformation to each of the points P i
to create a new mesh. By displaying this new mesh, we see a transformed version
of K . If we repeatedly vary the transformation applied to the mesh K ,we'llseea
sequence of new meshes that appears to move over time.
An alternative view of this is that we leave the mesh K fixed, but repeatedly
change our virtual camera's position and orientation. We'll take the first approach
here, however. Not surprisingly, the two are closely related: Moving the object in
one direction is equivalent to moving the virtual camera in the opposite direction,
for instance (as long as there's only one object in the world).
Suppose we want to be able to view the object from all sides. We'll assume
that it's positioned at the origin so that applying rotations to it keeps it in the same
location, but with a varying attitude. How can we control the viewing direction?
One easy-to-understand metaphor is to imagine the object as being encased
in a large spherical block of glass (see Figure 11.10). This glass ball is so large
that if it were drawn on the display, it would fill up as much of the display as
possible. (For a square display, it would touch all four sides of the display.) We
can now imagine interacting with this virtual sphere by clicking on some point of
the sphere, dragging some distance, and releasing. If we click first at a point P and
release at the point Q , this is supposed to rotate the sphere so as to make the point
P move to the point Q along a great-circle arc (i.e., to rotate in the plane defined
by P , Q , and the origin).
Of course, when we click on a point of the display with the mouse cursor we're
not actually clicking on the sphere —what we get are the coordinates of the point
on the display surface. This in turn must be used to determine a point of the sphere
itself. Suppose, for now, that we know the position C of the virtual camera, and
that in response to a mouse-click, we are given the position of a corresponding
point S on a plane in 3-space that corresponds to our display (see Figure 11.11).
...
Move
Figure 11.10: The object being viewed is imagined as lying in a large glass sphere. Moving
a point on the surface of the sphere moves the object inside.
 
Search WWH ::




Custom Search