X3D Example Archives: Conformance Nist, Sensors, Visibility Sensor

 

VisibilitySensor detects when user can see a specific object or region as they navigate the world. The region sensed for visibility to the user is bounded by a rectangular box.

X3D Tooltips of interest: VisibilitySensor.

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

X3D Examples Archives of related interest:

 
  9 X3D Models       X3D Model Descriptions
   centersize centersize Test the size field for a VisibilitySensor node. A Sphere geometry has an associated VisibilitySensor in front of it, at point 0 0 0. The default ViewPoint is at point 0 0 10, looking down the -Z axis. Because the bounding box, with dimensions 4 4 4 is in direct sight, an isActive event is generated by the enabled VisibilitySensor node, which is routed to enable a TimeSensor node, which starts a color animation of the Sphere. When the user moves to the second viewpoint, behing the bounding box, at point 0 0 -10, an isActive=false event is generated and the Sphere ceases to change color.
   centersize_1 centersize 1 Test of the "center" field of a VisibilitySensor node. A VisibilitySensor (represented by an IndexedLineSet box) is in front of a red Sphere geometry. The "center" field of the VisibilitySensor is located at -100 -100 100 in the world coordinate system. A Viewpoint of -110 -100 110 places the view directly in front of the VisibilitySensor. Directly behind the VisibilitySensor is a Sphere geometry. The VisibilitySensor should generate an isActive true event and begin a color animation of the Sphere. When the viewer moves to the second Viewpoint, behind the bounding box, the color animation should stop.
   def_use def use Three instances (DEFs) of the same VisibilitySensor are associated with a Spherer geometry. Entering any one of the three instances should generate events that are routed to a common TimeSensor, ColorInterpolator and Transform node. The result is, when entering any of the bounding boxes, the Sphere geometry should change color from red to blue.
   default_visibilitysensor default visibilitysensor Test default VisibilitySensor properties. A Sphere geometry has an associated VisibilitySensor in front of it, at point 0 0 0. The default ViewPoint is at point 0 0 10, looking down the -Z axis. Because the bounding box, with dimensions 0 0 0 is in direct sight, an isActive event is generated by the enabled VisibilitySensor node. In addition, an enterTime event is generated, which is routed to a TimeSensor node to start an animation of the Sphere geometry. When the user moves to the second viewpoint, behind the bounding box, at point 0 0 -10, an isActive=FALSe event is generated, along with an exitTime event, and the Sphere ceases to change color.
   enabled enabled Test enabled field. A Sphere geometry has an associated VisibilitySensor in front of it, at point 0 0 0. The default ViewPoint is at point 0 0 10, looking down the -Z axis. A bounding box of size 4 4 4 is defined in the size field. The enterTime event is routed to a TimeSensor node to start a color animation of the Sphere geometry, and an exitTime event is routed to stop the color animation. However, because the enabled field is set to false, the animation will not start when the user moves to viewpoint 2 (behind the bounding box).
   isactive isactive A VisibilitySensor should generate an isActive event of true when the VisibilitySensor bounding box is in the field of view. A default Viewpoint places the viewer avatar directly in front of a VisibilitySensor bounding box, represented by a white IndexedLineSet. As a result, an isActive true event is sent to a TimeSensor to start a color animation of the Sphere geometry directly behind the bounding box. Moving to the second Viewpoint directly behind the bounding box should stop the color animation.
   multi_sensor multi sensor Test overlapping VisibiltySensors. Two unique VisibilitySensor nodes are associated with two unique Sphere geometry. The left VisibilitySensor (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 VisibilitySensor should change the color of the right Sphere from white to red when activated. The central "overlapping" area, when visible, by the viewers avatar, should concurrently activate both VisibilitySensors, and generate separate events for both of them. When viewpoints take the viewer avatar behind all of the bounding boxes, the color animation of the Sphere should stop.
   nested_trans nested trans A VisibilitySensor is "nested" in a "child" Transformation node. Therefore, it should translate appropriately with its parents Transformation parameters (-100 -100 100). The default Viewpoint places the viewer avatar in front of the nested Transform containing the VisibilitySensor and Sphere geometry. As a result, the the VisibilitySensor should route an isActive true event to a TimeSensor and start a color animation of the Sphere geometry behind it. The second viewpoint places the viewer avatar behind the VisibilitySensor bounding box and stop the animation.
   time time Test enterTime field. A VisibilitySensor bounding box is directly in front of a Sphere geometry. With the VisibilitySensor bounding box (represented by a white IndexedLineSet box) visible to the viewer, an enterTime field is generated and sent to a TimeSensor node to begin a color interpolation of the Sphere geometry. Moving to the second Viewpoint behind the VisibilitySensor bounding box sends the exitTime event to the TimeSensor to stop the color interpolation.

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