4.9.7.1 linear step - linstep( min, max, parameter )

We use the linear step function to animate the Y position of the sphere. We use the constant 1 as min argument, the constant 2 as max argument and the system variable time as the parameter argument:

sphere.YPosition = linstep( 1, 2, time );

We preview the result:

The linear step function returns 0 when the value of the parameter time is smaller as the min argumernt. The min argument is set to 1. So, if the time is smaller as 1 the Y value of the sphere will be 0.

The function returns 1 when the value of the parameter time is larger as the max argument. The max argument is set to 2. If the time is larger as 2 seconds the Y value of the sphere will be 1.

If the value of time is somewhere inbetween 1 and 2 the function returns a value between 0 and 1 resulting in a linear transition when the parameter is constantly increasing between min and max.

With the min and max arguments you can set a range in which the transition should happen. If the parameter is equal to the max value the function will always return one. If the parameter value is equal to the min value the function will always returns 0. This means that the min value can also be larger as the max value. When we change the code to this:

sphere.YPosition = linstep( 2.5, 0.5, time );

The result will be a linear transition of the spheres Y position between 1 and 0 when time is between 0.5 and 2.5:

Xpressionist 3.5