POV-Ray : Newsgroups : povray.advanced-users : Random, Displaying values, and a parsing logistics question: : Re: Random, Displaying values, and a parsing logistics question: Server Time
29 Jul 2024 18:22:21 EDT (-0400)
  Re: Random, Displaying values, and a parsing logistics question:  
From: Bob H 
Date: 2 May 2001 15:38:42
Message: <3af06242$1@news.povray.org>
"Eitan Tal" <eit### [at] netvisionnetil> wrote in message
news:3AF0680F.102B9B08@netvision.net.il...
> 1. How do I use a random value? I remember that a sample had shown that.

#declare S=seed(123) // any aritrary number
#declare R=rand(S) // the random number put into R

> 2. is it possible to display a value to debug? #debug doesn't do that,
> nor #warning.

You can send a float or string to the message stream by:

#declare MessageNumber=R;
#debug concat("Random number is ", str(MessageNumber,3,1),"\n")

> 3. if I use a random texture for a single object:
>
> #declare myObject = box {<0,0,0> <1,1,1> pigment {color rgb <random,
> random, random>}}
>
> and do:
>
> object {myObject}
> object {myObject translate <1,0,0>}
>
> will they have different colors?

No.  Were it a pigment pattern instead and you moved it before adding
texture it would potentially change.  You're asking if the colors randomize
later though and no it does not (should not).

Bob H.


Post a reply to this message

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