Linear controls are implemented using PlaneSensor2D along with a Valuator which changes the motion to a value in the range 0 to 1. This may then be adjusted later, with another Valuator, to get the actual range of values finally needed, such as from 40 to 240 for the rectangle size. The output of the rotary controls, i.e from the DiscSensor, have been directy used in both cases.
Note: properties such as emissiveColor, size and scale are Vec3f and Vec2f respectively. The properties can only be set as a whole in the nodes such as is done with say a ColorInterpolator. The ability to manipulate independently the R,G,B parts of the color has been achieved simply using valuators and routes along with an interpolator of the right type so that we can generate the right type out of a valuator. For example, for the RGB, the 0 to 1 output of each slider is fed to Factor1, Factor2 and Factor3 of the same valuator, from the R,G and B sliders respectively. Also each slider output is fed to a ColorInterpolator which is set to interpolate from (1,1,1) to (1,1,1), i.e for any input value in the range 0 to 1 it will always output the same color. So the slider for the color sets the appropriate Factor and then the (1,1,1) is routed through the valuator, gets altered by the respective factors for each component, and then the resultant outSFColor is fed to the emissiveColor. Since each factor is independent we can set each color component independently. Size and scale have been done similarly but with an additional valuator to adjust the required output range.
Snapshot taken after manipulating the controls
![]() |