POV-Ray : Newsgroups : povray.binaries.images : Stony ground with ant (218K) : Re: Stony ground with ant (218K) Server Time
31 Jul 2024 10:16:36 EDT (-0400)
  Re: Stony ground with ant (218K)  
From: Thomas de Groot
Date: 11 May 2010 04:28:55
Message: <4be91547@news.povray.org>
"Jim Holsenback" <jho### [at] povrayorg> schreef in bericht 
news:4be82250$1@news.povray.org...
> ha ... new one on me as well! since you've used it, perhaps you could
> come up with a sentence or two and i'll add it to the wiki docs
>
> i'll watch this thread or you can put it over here:
> http://wiki.povray.org/content/Documentation_Talk:Reference_Section_7.3
>

Well, you could maybe use something like this:

Prob(P, RS)
The probability macro returns true or false. P is the probability of 
returning true (value between 0 and 1) RS is a random number stream.
Example code:
//start code
//If you want a 40% chance of red objects amongst blue ones
#local ObjProb = Prob(0.4, r);
object {
  #if (ObjProb)
    RedObj
  #else
    BlueObj
  #end
  .....
}
//end code


Thomas


Post a reply to this message

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