Reviews : Java Books : 3D User Interfaces with Java 3D :


Title: 3D User Interfaces with Java 3D
ISBN: 1884777902
US Price: $49.95
© Manning Publications Co.

19.2.3 IntuitiveDragMapper class

Conversion from 2D input space to 3D source space is performed by the Intuitive-DragMapper class. It uses an IntuitiveDragMapperPlugin to handle the details of translating between spatial coordinate systems and event types. Subclasses of this plug-in are provided to support DRM and several flavors of WRM. Each handles acquisition and use of source space reference nodes differently. Specifics will be covered in later sections on DRM and WRM. The internal interface between the mapper and its plug-in are similar to those between the InputDragMapper class and its plug-in, the InputDragMapperPlugin.

By definition, input to source mapping is a point mapping, meaning that the input position is mapped to a source position using a point transformation rather than a vector transformation. The distinction is subtle, but important when setting up an input drag filter chain to feed an intuitive Mapper. The mapper's input event interface is InputDragTarget, and its output event interface is SourceDragTarget.

SourceDragTarget interface

The SourceDragTarget interface is essentially a 3D version of the 2D InputDragTarget interface, including methods for drag start, drag continuation, and drag stop. In place of a source display, the methods use a source scene graph node to define the local source space. The corresponding event splitter is the SourceDragSplitter class.

19.2.4 SourceDragFilter class

Source drag filtering is quite similar in form and function to that of input drag filtering. The SourceDragFilter class is the host for all filtering operations, with a plug-in giving it a personality. The plug-in base class, SourceDragFilterPlugin, has the same basic internal interface and is used the same way by its host as the InputDragFilterPlugin described for basic control interpretation. It also has the same limitation of being able to handle only the simplest forms of filtering, which do not involve state or time-dependent processing.

SourceDragFilterPlugin subclasses

Although all the same filter operations could be provided as for input drag filtering, the framework provides the two most common ones. The AbsoluteSourceDragPlugin class provides absolute filtering, with a 3D point specifying the origin of the drag operation The RelativeSourceDragPlugin class performs relative origin filtering, with the 3D origin being determined by the starting point of the drag. No source drag enable filter is provided because drag enabling can be handled from the input drag space— in a POCS there is no 3D mouse sensor to directly generate source drag events.

19.2.5 SourceDragMapper class

The SourceDragMapper class handles the conversion from source space to actuation space. Both the source-to-target and the target-to-actuation spatial conversions are included in this Mapper. A method is provided to specify whether or not drags are cumulative. Consistent with other mappers in the framework, a plug-in, the SourceDragMapperPlugin class, handles the rest of the mapping details. The internal interface between the mapper and the plug-in is similar to that in the InputDragMapper class.

By definition, source-to-target mapping is a vector mapping, meaning that the source position value is treated as a vector, with direction and magnitude being transformed instead of position. As with intuitive mapping, the distinction is subtle but important when building a source drag filter chain to feed a source Mapper. The mapper's input event interface is SourceDragTarget, and its output event interface is ActuationTarget.

DirectSourceDragPlugin class

The framework provides only for direct source mapping, with the DirectSourceDragPlugin class. It includes methods for specifying source value scaling and target value offset. All mapping is direct and by dimension, similar to that for input drag map-ping, but here two separate mappings are used: one for source-to-source dimension mapping, and the other for target-to-actuation dimension mapping. Mapping occurs in three steps. First the source-to-source dimension mapping is applied to the source value, then the source value is spatially transformed to the target space, and finally the target-to-actuation dimension mapping is applied to the target value.

AxisAngleSourceDragPlugin class

To handle source drag rotations, the framework provides the AxisAngleSourceDragPlugin subclass of DirectSourceDragPlugin. To accommodate the generalized map-ping from source to target space, a simple fixed-axis rotation can not be used. Instead, a fixed rotation axis is defined relative to the source space, and the axis is spatially transformed as a vector to the target space. The angle of rotation defined by the source value, however, is not spatially transformed as would normally be done in the superclass. Instead, it is mapped directly, by dimension, from source to actuation spacing using the combination of the source and target mappings.

Stop by in one week for the next installment!

How to Add Java Applets to Your Site

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.