19.3 DISPLAY-RELATIVE MAPPING
DRM is a dynamic coordinate mapping technique that controls a target object
according to display relative inputs, such as from the mouse or arrow keys. In terms
of source and target spaces, DRM generally uses the view itself as the source space
node and the actuator's target transform group is used as the target space node.
At a conceptual level, the DRM process can be summarized as follows. When the
user moves the drag cursor left in the display, the intuitive drag mapper interprets that
motion as occurring in 3D in the plane of the view's display. In turn, the source drag
mapper obtains the view's local-to-Vworld transform, and transforms the local display
movement into the equivalent motion expressed in absolute world space coordinates.
The mapper then obtains the actuator target's local-to-Vworld transform, inverts it,
and then transforms the world space movement into an equivalent motion in the target's
local coordinate space. If, for example, the target actuator performs geometric
translation, then the target object will always appear to move left in the display regard-less
of the position or direction of the view.
Table 19.3 summarizes the classes associated with DRM intuitive mapping.
Figure 19. 4 illustrates the relationship of these classes. The next example will demonstrate
how to configure these and the rest of the intuitive mapping building blocks for DRM.
Table 19.3 Summary of classes related to DRM intuitive mapping
| Class/Interface | Description | Input Events | Output Events |
| IntutiveDragMapper | A coordinate mapper for input
drag to source drag conversion.
Uses a plugin to perform a specific
type of coordinate mapping |
InputDragTarget | SourceDragTarget |
| IntuitiveDragMapperPlugin | The abstract base class for intuitive
drag mapper plugins
| | |
| DrmPlugin | An intuitive drag mapper plugin
that maps the 2D input drag to
the Z= 0 plane of the source
space
|
| |
19.3.1 DrmDragPlugin class
For support of DRM, the framework provides the DrmDragPlugin subclass of IntuitiveDragMapperPlugin.
The plug-in has very little to do. Because in DRM the intent
is for the user's control inputs to be interpreted relative to the display space, the plug-in
simply maps the 2D drag input to the Z= 0 plane of the 3D source space. In other
words, for DRM, the source space is the view space with the input drag confined to its
display plane. (The intuitive drag mapper plug-in will play a more prominent role in
WRM than it does in DRM.)
The constructor for DrmDragPlugin gives you a choice for how the source node
is selected. Either you can let the input event's source display define it, in which case
the source display's ViewingPlatform is used, or you can set it explicitly, such as with
a node in the same space as the view. In any case, the source node is passed along with
the mapper's output SourceDragTarget event for use by the source drag Mapper.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|