1
$\begingroup$

How do you generate a random value from between two values of my choosing? So, for example, I want to generate random evenly distributed values from between, say -.5 and 7? what is the node setup to achieve this?

Thanks JK

$\endgroup$
2
  • $\begingroup$ You mean "random" for each object? Using the Object info node and some math or "random" through the same object (ex: per face, per vertex..)? $\endgroup$
    – Carlo
    Commented Jul 10, 2017 at 21:36
  • 1
    $\begingroup$ So you mean "random"... what? What kind of node editor are you interested in? Could you make an example of usage of this random value? $\endgroup$
    – Carlo
    Commented Jul 10, 2017 at 21:41

1 Answer 1

3
$\begingroup$

Duarte Farrajota Ramos came up with a better suggestion with the Object Info > Random value. Then you just run it into a standard linear interpolation function t*(a-b)+b. If you're feeding in random numbers 0..1 it does not matter whether a<b or a>b. You still get a value in the range a..b.

enter image description here

The extra nodes at the bottom with the vector coordinate going into the noise texture will give you a solid color, but it will be identical on all objects that use that material.

$\endgroup$
4
  • $\begingroup$ imgur.com/b8mputo $\endgroup$
    – JKCapeTown
    Commented Jul 10, 2017 at 21:58
  • $\begingroup$ Hi Mutant Bob - thanks - not quite right - can you see my imgur above? the material is then noisy. it should be a solid colour randomly chosen from within the wavelength limits - side question: shouldn't you subtract the small number from the large one? $\endgroup$
    – JKCapeTown
    Commented Jul 10, 2017 at 22:00
  • $\begingroup$ @JKCapeTown Adding a Normal node connected to the Vector input of the noise texture will make the color solid. $\endgroup$ Commented Jul 10, 2017 at 23:25
  • 1
    $\begingroup$ Use the same node setup, instead of a Noise texture as input use the Random socket of a Object Info node $\endgroup$ Commented Jul 11, 2017 at 1:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .