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.

Actions and interactions

  • 13.1 Spatial transforms
  • 13.2 Object picking
  • 13.3 Behaviors
  • 13.4 Summary

System action and user interaction in a 3D application can take many forms. Actions are automatic manipulations of an object or the view by the system, such as turning an object in a preview or blinking the eyes on an avatar to make it seem more lifelike. Actions are also called animations, where objects in the scene appear to move of their own volition. With actions the user is a passive observer; there is no two-way dialogue between the system and the user as in interaction. With interaction the user's involvement is usually direct and explicit, such as in-scene mouseover feedback and object dragging. Actions and interactions can occur in the 3D scene as well as outside of it, in the 2D area surrounding the 3D display in the application's window frame. With Java 3D the focus is on in-scene activities, which is the subject of this chapter. Associations between Java 3D and out-of-scene interaction will be covered in chapter 14.

This chapter and the next roughly divide Java 3D actions and interactions into spatial transformations, object picking, and behaviors. Spatial transformations are the basis for all geometric manipulation of objects and views in the virtual world; object picking identifies what the user is pointing to in the scene; and, behaviors, as embodied by the Behavior class, are the basis for Java 3D event handling, especially collision and change detection.

All of these capabilities play (or should play) major roles in UI work. Unfortunately, picking and colliding in particular are rather poorly documented and loosely defined in the API specification. This, together with the fact that source code is not included with Java 3D means that a lot of the details about these areas can be obtained only through a process of trial and error. Rather than ignore these important UI capabilities or to only treat them lightly, I've chosen to dig into the details, so be warned. Any details covered here about these subjects could easily change with future releases of Java 3D.

13. 1 SPATIAL TRANSFORMS

Any time the system slides an object in the scene or rotates one, either as a result of a programmed action or a user interaction, a TransformGroup group node is likely to be involved. This node, together with its associate, the Transform3D class, is at the heart of all geometric manipulation in Java 3D. Being a group node, it can have child nodes; but its distinction among group nodes is that any change to its Transform3D component object influences the geometry of its child nodes, as a group. For example, specifying a 10-meter shift in a TransformGroup node would cause its child objects, as a group, to move 10 meters relative to the node. If the node's parent was itself a TransformGroup node with a 10-meter translation in the same direction, then the net result on the child objects would be a 20-meter translation— the combination of the two translations.

Although the framework in the next part of the book uses spatial transforms extensively, it does so in a manner that does not lend itself to nice, clean code samples. The details of why this is so will be left for the discussions in part 4 about the frame-work. For now, code fragments at the end of this section will illustrate how to use TransformGroup and Transform3D in some practical UI situations. If you are curious and can't wait until the next part, spatial transformation in the form of generalized actuation and actuators can be found in the j3dui.control.actuatorspackage in the framework.

13.1.1 Local coordinates

Another way of looking at a TransformGroup node is that each one defines a local 3D coordinate system inside the virtual world space, and its child nodes live within this local space. As the local space is moved, rotated, and stretched by the host node's transform, so too are the child nodes. The implication of nesting transform groups in the scene graph is that their coordinate systems become nested. For example, causing a transform node that is high up in the scene graph to perform a rotation has the effect of rotating the local space of its children and, correspondingly, that of any lower-level nodes. Any visible leaf node descendants in these nested coordinate systems, high or low, will also appear to rotate. This is shown in figure 13. 1 where three north-pointing arrow shapes are placed under three different groups, each with a different local coordinate space. The bottommost shape receives the combined effects of the 90-degree rotations from its parent and grandparent TransformGroup nodes, with a combined rotation of 180 degrees as seen by the user.

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