IBM TJ Watson Research

IBMDiscSensor

IBMDiscSensor.mp4

Description

A Rectangle shape, containing text, can be rotated by use of a DiscSensor whose rotation_changed output is routed to the rotationAngle field of the Transform2D containing the rectangle and text. The check boxes at the top left of the screen allow the DiscSensor's enabled and autoOffset fields to be set true or false. When disabled the rectangle cannot be rotated.

The rotation_changed, trackPoint_changed and offset from the DiscSensor are routed via Valuators, to convert the values to strings, so they can be displayed in Text nodes at the top of the screen. Offset will be set after dragging, when the mouse is released, but only when autoOffset is set true.

The radio buttons at the bottom of the screen allow the DiscSensor's minAngle and maxAngle to be set. When a button is selected the rotation of the rectangle and text is set back to 0 and the offset is set back to 0 too so its back in the upright position and will commence rotating from there. There are four min/max angle values which affect the bounds over which the rectangle can be rotated:

The rotation_changed will reflect the above limits as can be seen by rotating the shape and observing the value. When bounded the rotation value should never go outside of the bounds that have been set via the minAngle and maxAngle.

Screenshot

Snapshot taken during rotation



Back to main index