7.2 When to use Kontrolleur

Usually you will start working in XP and at some point want to test some of your expression scripts with different values for your variables. In our example you start with an expression, that moves a ball on a sine wave on the X axis. We'll use basically the expression found in this manual.

/*

This script moves the ball on a sinewave into +X direction

*/

// The main variables of the waveform - also refer to sine() in the manual.

double a = 1; // modifier value Frequency
double b = 0.5; // modifier value Amplitude
double c = 0.2; // modifier value Shift
double d = 0; // modifier value Phase

// The Ball object is moved to the right one units per second.

Ball.Position.X = (( time / 2 ) - trunc( time / 2 )) * 2; /* the expression loops after 2 seconds */

// The Balls Y position is calculated by a sine function.

Ball.Position.Y = sin(( time * 360 ) * a + d ) * b + c;

You will now want to change the modifier values of the sine wave to shape the wave to your needs. You can do this by entering Xpressionist and type in new values, or you can use animation channels of an object in the project window (custom variables) to change the value. At this point you will decide to use a Kontrolleur plugin for this rather than a null or any other object channel.

 

 

 

Xpressionist 3.5