1. NodeBox 3
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Download
  4. Documentation
  5. Forum
  6. Blog

Controlling Randomness

Randomness in NodeBox is not really random. It produces pseudo-random values controlled by an initialization value called the seed.

Each seed produces a different range of random numbers. The same seed will always give the same collection of random numbers. That’s why we talk about controlled randomness: within a certain collection, the ordering appears random:

This is actually very useful. As a designer, you might pick a certain random variation that you think looks good. It wouldn’t make much sense if NodeBox would change the output when you reopen the document. The seed gives us a way of creating variation without giving up control.

Everywhere a NodeBox node uses a random value, it provides a seed parameter for you. Nodes such as the pick node, random numbers node and wiggle node will always produce the same result for the same seed.

Here’s an example:

If you look at the output of the combine node, you’ll see that they both have the same random variation. That’s because they share the same random seed.

Same wiggled stars

In wiggle2, change the seed to 2. Note that the two stars now look different.

Different wiggled stars

The actual number of the seed is unimportant. Seed 10 is not “more random” than seed 1. See it as the index number of a certain variation.