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

X3D Example Archives: Conformance Nist, Sensors, Cylinder Sensor

X3D Scenes Descriptions
autooffset Test the function of CylinderSensors autoOffset field, when autoOffset is true (the default) and false. The IndexedFaceSet on has a CylinderSensor node associated with it, and its autoOffset is set to "false". The result is, the IndexedFaceSet should "snap back" to its initial position at the beginning of each new drag motion over the geometry.
default cylinder Test default CylinderSensor properties. A default CylinderSensor is assigned to an IndexedFaceSet geometry. The rotation_changed fields from the CylinderSensor are routed to the transform node for the same geometry. As a result, moving the geometry should result in, when moved from the side, a "cylinderlike" rotation when viewed from the front, back or side. The geometry should keep its orientation after each "drag" motion of the pointing device.
default disk A default CylinderSensor is assigned to an IndexedFaceSet geometry. The rotation_changed fields from the CylinderSensor are routed to the transform node for the same geometry. As a result, moving the geometry should result in, when moved in a circular motion, a "disklike" rotation when viewed from the top or bottom. The geometry should keep its orientation after each "drag" motion of the pointing device.
enabled Test the function of CylinderSensors field "enabled". An IndexedFaceSet geometry has an associated CylinderSensor node, with the "enabled" field set to false, and its rotation_changed field routed to the geometrys Transform node. As a result, despite the routing of the rotation_changed event from the CylinderSensor node, the geometry should not rotate when the pointing device is "dragged" over the geometry.
isactive Test if the CylinderSensor node isActive field can be routed to other node. A box-shaped IndexedFaceSet geometry has an associated CylinderSensor, which routes its isActive event to an associated PointLight. When the primary pointing device buttons is depressed while over a geometry, the associated PointLight will turn on. Letting up on the pointing device button should turn the light off.
minmax disk Test if user can clamp rotation_changed events to a range of the angles specified by the minAngle and maxAngle fields for disklike rotation. Rotation angles (from left to right) of positive/negative 360 degrees, are applied to an IndexedFaceSet geometry. When viewed from the top or bottom, all geometry should rotate in a "disklike" manner one full rotation in both directions.
multisensor Test if a CylinderSensor grabs all further motion events from pointing device when the sensor generates "isActive" true event for primitive geometry. The Box geometry has an associated CylinderSensor that routes its "rotation_changed" events to that geometrys Transform node. As a result, pressing the primary pointing device button while over the Box should rotate that geometry. In addition, a TouchSensor is assocated with the Box geometry and a PointLight, but is nested "higher" in the sensor hierarchy. Passing the primary pointing device over the Box 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 down should generate an isActive = true event for the CylinderSensor and prevent the TouchSensor from activating (and the PointLight from coming ON), When the button is released, and the cursor is over the Box, the PointLight should turn on.
offset Test the function of CylinderSensors offset field, when autoOffset is false. The offset field (from left to right) is set at -3.14, -1.57, 0, 1.57 and 3.14 radians. The result is that the geometry will initially rotate by these amounts respectively, when the pointing device indicates each geometry. The results (when each geometry is selected) should be, from left to right when viewed from the front: Box 1s GREEN face should face the viewer. Box 2 should face the viewer at a 45 degree angle, with a RED left face and a YELLOW right face at 45 degrees to the viewer. Box 3 RED face should face forward Box 4 should face the viewer at a 45 degree angle, with a BLUE left face and a RED right face at 45 degrees to the viewer. Box 5s GREEN face should face forward
trackpoint changed Test the CylinderSensors node ability to send "trackPoint_changed" events to other node. A CylinderSensor is associated with a Cylinder geometry. In addition, a red Sphere receives the "trackPoint_changed" event as the pointing device is dragged over the geometry. The result is, the red Sphere follows the pointing device while it is over the geometry an the primary button is depressed. The motion will follow the invisible cylinder whose axis is the Y axis, and whose radius is the distance from the Y axis and the intersection of the pointer bearing and the geometry. As a result, the ball will appear to follow the Cylinder surface as the cursor is dragged over the geometry. trackPoint_changed events are undefined when the pointing device is dragged outside the bounds of the geometry.
unison Test if a CylinderSensor works in "unison" with a "sibling" TouchSensor associated with the same Box geometry. The Box geometry has an associated CylinderSensor 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 rotate that geometry, while the PointLight remains on. When the cursor is released, the Box should stop rotating. When the pointing device is no longer over the Box, the PointLight should turn off.

Online at http://www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/CylinderSensor

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

Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details 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.