Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Next Chapter Summary X3D Resources

X3D Example Archives: VRML 2 Sourcebook, Chapter 27 - Sensing Visibility Proximity Collision

Sensing viewer activity enables the scene to trigger animations. A VisibilitySensor node checks if a region is visible to the viewer, where the region is described by a center and a size. Time events are sent on entry and exit of visibility, and true/false is sent on entry and exit of visibility. A ProximitySensor node similarly checks if the viewer is within a region, also sending viewer position and orientation while within the sensed region. Collision is a grouping node that checks if the viewer has run into a shape defined by the node's children (or else simpler proxy geometry) with a collision time event sent upon contact.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 27.1 Visibility Sensor Dungeon Sliding Doors
  3 X3D Scenes       Scene Descriptions
Figure 27.1 Visibility Sensor Dungeon Sliding Doors A dungeon door that slides open when visible, and slides closed when not visible. When you are look away from the door it goes shut, then it reopens when you look back. Page up/down between the first two viewpoints to observe this behavior. Arrow keys also help you peek left/right. Interesting side effect: users can't back up through the closed door.
Figure 27.2 Proximity Sensor Dungeon Sliding Doors A dungeon door that slides open when the ProximitySensor detects the viewer close enough. Later the doors close when the viewer moves out of range from the ProximitySensor.
Figure 27.3 Collision Detection Spinning Orb An orb that animates (for a single revolution) when the viewer collides with its box proxy shape. Walk towards the orb by using the up-arrow key.

Online at http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision

Validate XHTML 1.1

Master source code archive is under subversion control at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision

Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Next Chapter Summary X3D Resources

Also available: current and archived nightly builds and distributions of these examples, all published under an Open-Source License.

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.