POV-Ray : Newsgroups : povray.general : Controlled Randomness : Re: Controlled Randomness Server Time
4 Aug 2024 06:10:44 EDT (-0400)
  Re: Controlled Randomness  
From: Gilles Tran
Date: 1 Jul 2003 14:57:48
Message: <3f01d9ac$1@news.povray.org>

3f019b23$1@news.povray.org...
> There was a reference to 'controlled randomness', or placing many
> objects in such a fashion as to make a scene look relatively complex.

It looks that I gave a important-sounding name to something which is not so
difficult in fact ;)
It's completely scene-dependent, but it comes down to something like this :
- define an array of different objects (i.e. 5 objectss)
- define a rule (pattern or trace()) for the object position (in 2 or 3
dimensions)

Then loop through the number of total objects you want (i.e. 1000)
- define a position = rule + random value
- define a random scaling value
- I often add random mirroring to get more diversity
- define a random rotation value
- define other random values, such as texture properties
- choose an object at random from the array
- scale, rotate and then place the object

Add parameters to control the amount of randomness you want.
It's also very useful to control the distribution of the random values
(using pow(rand(rd),2) for example).

An example is given here :
http://www.oyonale.com/ressources/english/mkofdark4.htm
In the Makecloud2 scenes below, see the code that creates the lines or
groups of trees
http://www.oyonale.com/ressources/english/sources13.htm

G.

--

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.