PlaneSensor Node

The PlaneSensor node maps the mouse movement into the XY plane, moving the shape in the XY plane of its local coordinate system. See Dragging Sensors for more information on this type of sensors. This node allows you to limit the draggin operation to a rectangular area.

In addition to the fields which are common to all dragging sensors, this node has the following fields:

maxPosition which specifies the maximum X and Y.
minPosition which specifies the minimum X and Y.

Note: if maxPosition is lower than minPosition for an axis, then the movement is not limited for that axis. By default the movement is not limited in neither X or Y.

Syntax: 
PlaneSensor { 
    enabled TRUE 
    offset 0 0 0  
    autoOffset TRUE 
    maxPosition -1 -1
    minPosition 0 0

In addition to the exposed fields presented in the syntax the CylinderSensor node generates the following events (see Dragging Sensors for a description of their meaning): 
Example: Using a PlaneSensor to move a Sphere in a rectangular area defined by (-1,-1), (1,1). 

First one needs to create a group node which will include both the sensor and a Transform node containg a Sphere geometry. 

#VRML V2.0 utf8 

Group { 
    children [ 
        DEF ts PlaneSensor {
            minPosition -1 -1
            maxPosition 1 1
        } 
        DEF tr Transform { 
            children Shape {geometry Sphere {}} 
        } 
    ] 


Now we need to create a route between the eventOut translation_changed from the PlaneSensor to the exposed field translation of the Transform node. The route to achieve this is: 

    ROUTE ts.translation_changed TO tr.set_translation 


Note: On the VRML example provided the axes are not inside the same group as the sensor.