8.5 ATTACHMENT
When assembling objects in the real world to form a more complex whole there must
be some means for holding the objects together. Real world attachments can be whimsical
(bailing wire and chewing gum), utilitarian (nails, glue, welds), ingenious (snaps,
zippers, Velcro), and specialized (magnetic, tongue-in-groove, ball-and-socket). The
quality of attachment can be permanent (welds), temporary (Velcro), and even non-rigid
(ball-and-socket). In a virtual world, as in the real one, connecting objects
together and specifying the nature of that connection can be important. This is especially
so in 3D design applications, where object assembly is often a major goal.
Table 8. 4 summarizes the specific forms of attachment covered in this section, and
figure 8. 16 illustrates them.
| Table 8. 4 Attachment types and characteristics |
| Snapping |
- Not real attachment; touching
- Objects jump into position without permanence
| |
Gluing |
- Rigid physical attachment; touching
| |
Sticking |
- Non-rigid physical attachment; touching
- Objects can slide and twist according to attachment type
| |
Linking |
- Logical attachment; non-touching
- Topology of attachments maintained when objects are pulled
| |
Anchoring |
- Fixes object geometry in world space
- Generally needed if sticky attachments are involved
|
The distinction between attachment and grouping can be murky. For this discussion,
attachment is confined to a one-to-one relationship between two connected
snap elements, whereas grouping implies a possibly diffuse relationship among two or
Figure 8. 16 Examples of object attachment.
more objects that are probably not touching and may only be for convenient reference.
Although some aspects of grouping involve manipulation, many others are more
closely associated with data access and management; therefore, grouping will be covered
in the next chapter.
8.5.1 Physical versus logical
Physical attachment is analogous to real-world attachment, where objects maintain
some spatial or geometric relationship between them, which can be rigid like a weld
or flexible like a ball-and-socket. This has both visual and functional implications.
Pulling on an object that is physically attached to others can often cause the other
objects to also move. Also, physical attachment typically requires that the objects
involved be touching. For this reason, snapping is generally required before physical
attachment can occur. Two snap elements that are touching but not yet attached are
considered to be "primed" for attachment.
Logical attachment is where objects maintain some abstract or topological relationship.
Pulling on an object that is logically attached to other objects does not necessarily
move the other objects. Also, logically attached objects generally do not touch,
and their attachments are often shown visibly with relational indicators, such as lines
and arrows. For example, logical attachment is often used in applications involving
networks, such as for communications or manufacturing, where the topology of the
layout, not its literal geometry, is significant. In such cases, nodes in the network do
not touch and could be dragged around in the scene, with their connections stretching
and bending accordingly.
8.5.2 Attachment versus snapping
Snapping and attachment are usually separate operations. For example, you might
perform a "dry fit" to assemble objects the way you think they should go, using snap-ping.
When you are satisfied with their fit, you would apply the attachment "glue" to
hold them all together. Because of the difficulty of getting objects together in the
right geometry so they can be physically attached (their snap elements must be touching,
or primed), snapping of some sort is generally necessary before physical forms of
attachment can occur. Persistent forms of physical attachment such as "sticking" and
"gluing" will often be combined with snapping such that snapping and attachment
are performed as a single operation. Thus, objects that are snapped together are also
immediately and persistently attached together.
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.
|