POV-Ray : Newsgroups : povray.general : Controlled Randomness Server Time
5 Nov 2024 07:15:35 EST (-0500)
  Controlled Randomness (Message 1 to 4 of 4)  
From: How Camp
Subject: Controlled Randomness
Date: 1 Jul 2003 10:30:59
Message: <3f019b23$1@news.povray.org>
I enjoyed reading Gilles Tran's explanation of how "Reach For the Stars" was
created.  There was a reference to 'controlled randomness', or placing many
objects in such a fashion as to make a scene look relatively complex.

I've had no luck trying this myself.  I can randomly place object on
surfaces, etc. via the trace() function, and even store an object's xyz
coordinates in an array, along with some pseudo-volumetric information to
try and avoid collisions (which I'm not doing very well).

Could anyone give me some ideas as to how this might be done efficiently?

- How


Post a reply to this message

From: Gilles Tran
Subject: Re: Controlled Randomness
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

From: How Camp
Subject: Re: Controlled Randomness
Date: 1 Jul 2003 18:28:20
Message: <3f020b04$1@news.povray.org>
"Gilles Tran" <tra### [at] inapginrafr> wrote in message
news:3f01d9ac$1@news.povray.org...

> 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)

I think it's the 'define a rule' portion I'm having trouble with.  I can't
seem to avoid collisions in an efficient manner.  I'll try and digest your
examples, and see what I can come up with.  Thanks for the pointers.

- How


Post a reply to this message

From: Gilles Tran
Subject: Re: Controlled Randomness
Date: 1 Jul 2003 18:57:30
Message: <3f0211da@news.povray.org>

3f020b04$1@news.povray.org...
> I think it's the 'define a rule' portion I'm having trouble with.  I can't
> seem to avoid collisions in an efficient manner.

You can have a look at the "stacks" scene files in the povray advanced
directory, as they include a collision detection mechanism (and not the most
efficient).
In my own scenes I almost never check for collisions so they won't be very
helpful.

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.