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

 

CylinderSensor converts pointer motion (for example, a mouse or wand) into rotation values using an invisible cylinder aligned with local Y-axis. Hint: this sensor detects user interactions affecting peer nodes and their child geometry.

X3D Tooltips of interest: CylinderSensor.

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

X3D Examples Archives of related interest:

 
  10 X3D Models       X3D Model Descriptions
autooffset 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 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 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 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 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 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 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 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 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 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 https://www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/CylinderSensor

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

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