This example is for the Node Editor of the
Instance Generator.
Input Node Example 12
Output used:
Fixed Random or
ID Index
Description: Outputs a random scalar between 0 and 1 (Fixed Random) or the ID of each instance (ID Index).
In this example I use it to control the rotation of the instances.
Normally, you can easily create a random rotation of instances. To do this, set a minimum and maximum rotation for the desired axis in the Rotation tab.
However, if you want a
random rotation in
fixed steps, this does not work here.
A simple node setup does the job. You control a gradient with the
Fixed Random output. The gradient has two keys with a value of 0 and 314.159 both set to
Step. The unit for the rotation is radian. 314.159 means 180° (actually it is 3.14159 but internally Lightwave reads 100% as 1 .....
).
I prefer to use an angle node instead because I don't always want to convert to radians.
Of course, you can extend the rotation to a small range around 0° and 180° so that not all cars are completely straight.
Because I control the color of the cars
also with the fixed random output all cars of
one color are in the
same direction.
This is not so noticeable here but can be very annoying in other situations.
To correct this, I'm adapting the setup a bit. The
ID Index output now provides the seed input for a
Random Scalar node, which controls the gradient.
The Add node gives the possibility to change the seed easily.
Finally, I added a little randomness to the offset (position).
Note: if you want to use the Node Editor to control rotation you have to set the rotation to
Uniform in the Rotation tab of the Instance Generator.
ciao
Thomas