Table of Contents Previous Directory Summary Directory Viewpoint Slideshow Javadoc for translated java source Next Directory Summary X3D Resources

X3D Example Archives: Conformance Nist, Sensors, Proximity Sensor

 

ProximitySensor generates events when the viewer enters, exits and moves within a region of space (defined by a box).

X3D Tooltips of interest: ProximitySensor.

X3D Specification sections of interest: 22 Environmental sensor component, 22.2 Concepts and 22.4.1 ProximitySensor.

X3D Examples Archives of related interest:

 
  10 X3D Models       X3D Model Descriptions
centersize_1 centersize 1 Test the "center" field of a ProximitySensor. A ProximitySensor (represented by an IndexedLineSet box) encloses a red Sphere geometry. The "center" field of the ProximitySensor is located at -100 -100 100 in the world coordinate system. All viewpoints should be orthographically correct (at 90 degree angles) to the ProximitySensor bounding box.When the viewers avatar enters the ProximitySensor bounding box, the sensor should route events to a TimeSensor node and start an animation that would change the color of the Sphere from red to blue.
centersize_2 centersize 2 Test the size field of a ProximitySensor. A ProximitySensor (represented by an IndexedLineSet box) encloses a red Sphere geometry. "Close up" viewpoints all intersect the ProximitySensor bounding box exactly at its boundary points. When the viewers avatar intersects the ProximitySensor bounding box, the sensor should route events to a TimeSensor node and start an animation that would change the color of the Sphere from red to blue.
def_use def use Test DEF of multipl ProximitySensors. Three instances (DEFs) of the same ProximitySensor are associated with a Sphere geometry. Entering any one of the three instances should generate events that are routed to a common TimeSensor node. The result is, when entering any of the bounding boxes, the Sphere geometry should change color from red to blue.
default_proximitysensor default proximitysensor A ProximitySensor with all default values is associated with a red Sphere geometry. The ProximitySensor, if activated (when the viewers avatar enters the bounding box of the ProximitySensor), should route events to a TimeSensor node and start an animation that would change the color of the Sphere from red to blue. Because the default bounding box size is 0 0 0, the ProximitySensor should be disabled, and not generate any events. Therefore, even at the second Viewpoint (located at the center of the ProximitySensor), the ProximitySensor will not activate, and the Sphere should not change color.
enabled enabled A ProximitySensor (represented by a box frame that coincides with the location of the ProximitySensor bounding box), encloses a red Sphere geometry. The ProximitySensor, if activated (when the viewers avatar enters the bounding box of the ProximitySensor), should route events to a TimeSensor node and start an animation that would change the color of the Sphere from red to blue. Because the "enabled" field is set to false, the ProximitySensor should be disabled, and not generate any events. Therefore, regardless how close the viewer gets to the Sphere, the Sphere should not change color.
isactive isactive Test isActive event. A ProximitySensor bounding box surrounds a Sphere geometry. Entering the ProximitySensor bounding box (represented by a white IndexedLineSet box) results in the ProximitySensor isActive event being sent to a TimeSensor node to begin a color interpolation of the Sphere geometry. Exiting the ProximitySensor bounding box sends the isActive false event to the TimeSensor to stop the color interpolation. The Sphere geometry should cycle from red to green to blue, then repeat the cycle until the viewer avatar leaves the ProximitySensor bounding box.
multi_sensor multi sensor Two unique (not instances of) ProximitySensor node are associated with two unique Sphere geometry. The left ProximitySensor (whose bounding box is represented by the IndexedLineSet box), should route its events to change the Color of the left Sphere from white to blue when the viewers avatar enters its bounding box. The right ProximitySensor should change the color of the right Sphere from white to red when activated. The central "overlapping" area, when entered by the viewers avatar, should concurrently activate both ProximitySensors, and generate seperate events for both of them. The result is, both Spheres should change from white to their respective colors of blue (left) and red (right).
nested_trans nested trans Test effect of nested Transforms. A ProximitySensor is "nested" in a "child" Transformation node. Therefore, it should translate appropriately with its parents Transformation parameters (-100 -100 100). Viewpoints in the root Transform node are offset by -100 -100 100, and should create orthographic (perfect 90 degree) views for all viewpoints. All inside views should appear identical. All outside views should appear identical. The Sphere geometry should turn color from red to blue for "inside" views.
orientation_changed orientation changed A ProximitySensor bounding box of size 10 by 10 by 10 surrounds a Sphere geometry. An avatar shaped like a pointing device receives both the position_changed and orientation_changed events generated by the ProximitySensor when the users pointing device enters its bounding box. The result is: when the user sequentially moves through the Viewpoint stack, the avatar will follow the cursor in both position (X, Y and Z) as well as orientation. When the viewer enters the bounding box, the avatar should always appear as a symmetric diamond with both a horizontal and vertical axis. Regardless of the avatar position inside the ProximitySensor bounding box, the avatar should always appear the same size and have the same orientation, stay positioned at the center of the viewing screen. When viewed from outside the bounding box, the avatar should appear at the perimeter of the bounding box, at its last exit point. The small end portion of the avatar should always intersect the perimeter of the bounding box when viewed from outside the bounding box.
time time Test enterTime field. A ProximitySensor bounding box surrounds a Sphere geometry. Entering the ProximitySensor bounding box (represented by a white IndexedLineSet box) results in the ProximitySensor enterTime being sent to a TimeSensor node to begin a color interpolation of the Sphere geometry. Exiting the ProximitySensor bounding box sends the exitTime event to the TimeSensor to stop the color interpolation. The Sphere geometry should cycle from red to green to blue, then repeat the cycle until the viewer avatar leaves the ProximitySensor bounding box.

Online at https://www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/ProximitySensor

Validate XHTML 1.1

Master source-code model archive is under subversion control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/ProximitySensor

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

Table of Contents Previous Directory Summary Directory Viewpoint Slideshow Javadoc for translated java source Next Directory Summary X3D Resources