advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

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.4.2 QuasiWrmDragPlugin class

True WRM, as defined by the WrmPlugin class, can be expensive because it requires continuous picking. There are also situations where a less general and more constrained form of WRM might even be desirable. The solution to both of these problems is a picking plane.

Picking plane

A picking plane offers a cheap alternative to full blown object picking if all you are interested in is a hit point. The picking plane is positioned to approximate the drag surface on a picked object. Then, during a drag, the source space hit point is computed by intersecting the same picking ray used for normal picking with the picking plane, which is significantly less demanding on the system than real picking. For situations that require it, this also constrains the source drag to a plane instead of the arbitrary surface of the source object. Instead of a picking plane, other shapes could be used that are easy to intersect with the picking ray, such as a sphere.

The framework provides utilities for handling picking planes in the Mapper class. The buildPickPlane utility builds a pick plane, given a hit point and a hit node defining the plane's reference space. The buildPickRay utility builds a pick ray (origin point and direction vector), given a display canvas and a pick cursor position in it. This is the same utility used by PickEngine for picking. The hitPickPlane utility inter-sects a pick ray with a pick plane and returns the 3D hit point.

Quasi-WRM

The QuasiWrmPlugin subclass of WrmPlugin offers a variation of WRM based on use of a picking plane. It uses discrete picking to select the source node at the start of a drag, the same as for general WRM, but during the drag it uses a picking plane. The discrete pick defines a source object and the initial hit point. The picking plane is placed such that it passes through the hit point and is perpendicular to the reference source space Z axis. Depending on the plug-in constructor used, the source reference space will be defined dynamically by the discretely picked source object, or statically by the source node specified in the constructor.

19.4.3 PseudoWrmDragPlugin class

Yet another variation on WRM is pseudo-WRM. As its name implies, it is not real WRM in that no source node picking is involved, but it does work a lot like quasi-WRM. Instead of placing a picking plane relative to the picked source node, however, it is instead placed relative to a picked target node, such as the target of the manipulation itself, the actuation target object. Because no source node picking is involved, the source space reference node must be specified statically, in the constructor. Thus, the picking plane is positioned relative to the target, through its hit point, but it is oriented according to the source node's reference space, as it is in quasi-WRM.

One of the pleasant side effects of pseudo-WRM is that the dragged target object will appear to be stuck to the drag cursor, no matter where the target is dragged or how the scene is viewed. This might seem a fortunate coincidence, but it is no coincidence. Pseudo-WRM is in essence true WRM, but with a single planar source node that always passes through the initial hit point on the target object. Thus, the projection from the hit point to the reference source object, which is what was needed for real WRM sticky cursor, is zero. With zero offset, the source point under the drag cursor is the same as the hit point on the object, and thus the target appears stuck to the cursor.

A variation of pseudo-WRM, provided by one of the constructors, is to specify the target node statically instead of using a picker. In this case, a drag operation will always use the specified target node's origin as the initial hit point, with the picking plane passing through it. In this particular form of pseudo-WRM, the target object will not always appear to be stuck to the drag cursor because of the possible offset between the cursor hit position on the object and the position of the object's origin.

19.4.4 Example: WrmMapping

This example demonstrates WRM of control inputs.

See
The virtual world contains three target objects (red, green, blue) inside a corner space formed by three orthogonal planes (a floor and two walls). A screen shot is provided in figure 19. 7.

Do

  • Drag the mouse (left button with SHIFT) in the display or use the ARROW keys (with SHIFT) to orbit the view in heading and elevation about the world origin.
  • Drag the mouse (left button) on the left (red) target to translate it along any plane beneath the mouse cursor.
  • Drag the mouse (right button) on the left (red) target to roll it relative to any plane beneath the mouse cursor.
  • Drag the mouse (left button) on the middle (green) target to translate it along the plane beneath where the mouse cursor started.
  • Drag the mouse (right button) on the middle (green) target to roll it relative to the plane beneath where the mouse cursor started.
  • Drag the mouse (left button) on the bottom (blue) target to translate it along the bottom X-Z plane.
  • Drag the mouse (right button) on the bottom (blue) target to roll it relative to the bottom X-Z plane.
  • Repeat the drag operations from different view directions.

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.

 Microsoft Visual Studio 2010 Showcase
 Avaya Developer Showcase
 MSDN Spotlight
 PHP for Windows Showcase
XML error: undefined entity at line 39
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Windows 7: From Beta to Final Code in One Year
Google Shows Off Chrome OS, Releases Source
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?
Fedora 12 Takes Aim at Linux Networking
Top Supercomputer Nearly Doubles in Speed
Fedora 12 Linux Tackles Virtualization
Apple Gives iPhone Developers App Status Tracker
Novell Sets OpenSUSE 11.2 Free

Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Exploring HTML 5's Audio/Video Multimedia Support
Overriding Virtual Functions? Use C++0x Attributes to Avoid Bugs.
Understanding the Cloud Computing Security Vulnerabilities
Cisco and IBM Target a Greener World
Upgrade to Visual Studio 2010 with the Ultimate Offer

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs