Graphics Reference
In-Depth Information
polling —checking to see if there are new events to be processed. (The distinction
is similar to that between preemptive and cooperative multitasking.)
Your choice of programming language, hardware, and operating system may
influence which variety of system you end up using. But none of these substan-
tially restrict general interface functionality: It's usually possible to get the same
results in all cases.
In all the examples that follow, we use click-and-drag functionality: Some
location(s) is/are selected, the location point is moved, and as a result something
else is changed. Finally, the selection is released. In the 3D manipulation exam-
ples, the location selection comes from a mouse click, the move comes from a
mouse drag, and the mouse-button release terminates the selection. In the photo-
manipulation example, the selection comes from a finger contact, the move comes
from contact motion, and the release comes when the finger is lifted from the
interaction surface. But in all cases, there are multiple states of the system:
• The pre-interaction state
• The “selected” state
• The “dragging” state
• And the post-interaction state
buttonPress
dragging
idle
In practice, we reduce this to two states: noninteraction and dragging. The course
of a typical interaction can be described by a finite-state automaton (FSA) with
these two states and four arcs (see Figure 21.4).
mouseMove
buttonRelease
Figure 21.4: We are usually in
the idle state. A click transitions
to the dragging state; dragging
remains there; a button release
returns us to the idle state.
In general, FSAs provide a good structure for planning interaction sequences,
which are seldom as simple as these. Unfortunately, as post-WIMP interactions
evolve, the associated FSAs can become impossibly complex (imagine the FSA
that might describe all possible interactions with your robotic butler in the future!),
but for WIMP interactions, they can be a very useful tool.
21.3 Multitouch Interaction for
2D Manipulation
Multitouch interfaces are becoming increasingly common. We manipulate pic-
tures on our smartphones using a thumb and index finger to translate and scale the
pictures, for instance. Let's consider the implementation of this 2D manipulator,
represented schematically in Figure 21.5.
Notice three things about the interaction.
1. The position of the touch points in the image remains approximately con-
stant. In the first case, the initial touch was a little above and to the left of
center; after the move, it remains in the same place.
2.
In the move-and-scale interaction, the fingers widen more horizontally
than vertically, but we have to choose a single scale amount. One
alternative is to resize the image to accommodate the larger change.
Another alternative is to average the horizontal and vertical widening frac-
tions (i.e., a vertical stretch of 20% and a horizontal stretch of 30% would
result in a uniform scale of 25%). A third possibility, and the one we
choose, is to scale by the ratio of contact distances: If the distance between
the contacts doubles, we scale by a factor of two.
 
 
Search WWH ::




Custom Search