AXEL Host Web Page

AXEL Random Event Demo 
(c) 2002 Jane Veeder

Purpose: Trigger an event randomly in time

Method: Deselect all objects and create a new Material and select any single-value parameter such as Shininess. Then, select Interact > Add Reaction > Custom... After MaterialName.Shininess =" insert a random( , ) function. Then edit the function to make it read "random(1,6)" so the function will generate random numbers between 1 and 6. Press OK to exit.

In order to have this function produce a continuous stream of random numbers, add a TimePulse Sensor and link it to trigger the CustomReaction. To see this number, you can create a text layer, select the "Text" parameter and select Relate > Add Custom Relation. Place your cursor after the script text, select the Shininess parameter of the material, then press "Insert World Selection" in the script editor. So, you get textlayername.text = material.shininess, where "=" means "gets the value of".

Now you need some event to trigger randomly such as a scale, orientation, or translation animation applied to an object. Then, add a ParameterRange Sensor, set its range to min 3.0, max 4.0, and link it to the animation reaction. To tune the timing, vary the settings of the timepulse sensor, random function, and the parameter range sensor.