<<VRML 2.0 - An Introductory view by examples

SphereSensor

[example]                                               [run]


This node maps pointing device motion (e.g. mouse) into spherical rotation (rotation_changed) about the origin of the local coordinate system. Event generation occurs if the device touches any of its parent's descendent geometry.

{
exposedField SFBool autoOffset TRUE # when TRUE offset is sent for device deactivated
exposedField SFBool enabled TRUE # if FALSE disabled
exposedField SFRotation offset 0 1 0 0 # value added to each actual sensor change
eventOut SFBool isActive # signalizes device is activated
eventOut SFRotation rotation_changed #
eventOut SFVec3f trackPoint_changed #
}

Usage :

here the touch of the geometry (contained in the Transformation node) will
generate events, which will be directed to the Transformation node (TRAN).

    Group{
      children [
           DEF SENSOR SphereSensor { }

           DEF TRAN Transform {
               some geometry 
                      }
                ]
          }

    ROUTE SENSOR.rotation_changed TO TRAN.set_rotation