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, Touch Sensor

 

TouchSensor tracks location and state of the pointing device, detecting when a user points at or selects (activates) geometry.

X3D Tooltips of interest: TouchSensor.

X3D Specification sections of interest: 20 Pointing device sensor component, 20.2 Concepts and 20.4.4 TouchSensor.

X3D Examples Archives of related interest:

 
  9 X3D Models       X3D Model Descriptions
enabled enabled A TouchSensor is associated with a white Sphere geometry. The enabled field is set to false. Because the TouchSensor is disabled, it will not generate fields when the pointing device is over the white Sphere, or when the pointing device indicates the geometry. As a result, the isActive event routed to the "on" field of a PointLight will not turn the light on when the pointing device indicates the white Sphere geometry.
hitnormal hitnormal Test hitNormal field. A TouchSensor is associated with a white Box geometry. A SpotLight is inside the Box geometry. Four red Spheres are above, below, to the left and right of the Box. The hitNormal_changed event from the TouchSensor is routed to the direction field of the SpotLight. The result is, when the pointing device is over the top, bottom, left or right face of the Box, the direction of that faces normal is routed to the SpotLight (turning the light). When the top face is indicated, the top Sphere should be illuminated. When the bottom face is indicated, the bottom Sphere should be illuminated. The same is true for the right and left faces.
hitpoint hitpoint Test the hitPoint_changed field. A TouchSensor is associated with a yellow Sphere geometry. Its hitPoint_changed field is routed to another red Sphere geometry. When the pointing device bearing intersects the yellow Sphere geometry, the red Sphere should translate (follow) the movement of the pointing device along the surface of the yellow Sphere, following the hitPoint.
hittexcoord hittexcoord Test hitTexCoord field. The right Box geometry has a TouchSensor associated with it. the TexCoord_changed field of the right TouchSensor is routed to the translation field of a TextureTransform node associated with the left Box. As a result, passing the pointing device over any of the right Box faces should result in a translation of the intersection of the pointing device and the right Box texture should correspond to the lower left texture coordinate of the translated texture on any of the faces of the left Box.
isactive isactive Test if a TouchSensor generates an isActive true event when the pointing device indicates a white Sphere geometry. The isActive event of the TouchSensor associated with the white Sphere is routed to the "on" field of a PointLight. When the pointing device indicates the white Sphere (by pressing down on the primary pointing device button while its bearing intersects the white Sphere geometry), the PointLight inside of sphere should turn on, illuminating the red Spheres around it. When the primary pointing device button is released, the PointLight should turn off.
isover isover Test if a TouchSensor generates an isOver true event when the pointing device bearing intersects the white Sphere geometry. The isOver event of the TouchSensor associated with the white Sphere is routed to the "on" field of a PointLight. When the pointing device is over the central white sphere, the PointLight inside of sphere should turn on, illuminating the red Spheres around it. When the pointing device bearing does not intersect the white Sphere, the PointLight should be off.
multisensor multisensor Test if a TouchSensor grabs all further motion events from pointing device and "overrides" a PlaneSensor that is higher in the sensor hierarchy. The Box geometry has an associated TouchSensor that routes its "isActive" events to a PointLights on field. In addition, a PlaneSensor, nested higher in the sensor hierarchy routes its trackPoint_changed events to the Boxs parent transform node. Passing the primary pointing device over the Box geometry and pressing down on the primary pointing device button should route and isActive event to a PointLight and illuminate the IndexedFaceSets. Dragging the pointing device over the Box geometry and holding the primary pointing device button should not move the Box. When the pointing device button is released, the PointLight should turn off.
touchtime touchtime Test if a TouchSensor generates a touchTime event when the pointing device indicates a white Sphere geometry. The touchTime event of the TouchSensor associated with the white Sphere is routed to the startTime field of a TimeSensor. The TimeSensor fields drive a PositionInterpolator that animates the movement of the white Sphere. When the pointing device indicates the white Sphere (by pressing down on the primary pointing device button while its bearing intersects the white Sphere geometry, then releasing the button while still over the white Sphere), the Sphere should begin to move.
unison unison Test if a TouchSensor works in "unison" with a "sibling" PlaneSensor associated with the same Box geometry. The Box geometry has an associated PlaneSensor that routes its "rotation_changed" events to that geometrys Transform node. In addition, a TouchSensor is also a child of the same Transform node. As a result, passing the primary pointing device over the Box should turn on a PointLight. Pressing the primary pointing device button while over the Box and "dragging" should translate the Box in X and Y, while the PointLight remains on. When the cursor is released, the Box should stop moving. When the pointing device is no longer over the Box, the PointLight should turn off.

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

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/TouchSensor

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