POV-Ray : Newsgroups : povray.general : random problem : random problem Server Time
14 Nov 2024 19:19:43 EST (-0500)
  random problem  
From: ingo
Date: 17 May 1999 16:56:20
Message: <37407464.0@news.povray.org>
While making some pieces of wood with different colours, using random, I ran
into a problem.
Run the scene below.
The first number from the random stream ia always 0.118 .
Now comment out "#declare XX = ....." , "#debug concat(....." and in the the
first pigment replace XX by "Rmm(0.1,0.5,Sd)".
Run the scene again.

Why are the colours different?


ingo

--
Met dank aan de muze met het glazen oog.

#version 3.1; global_settings {assumed_gamma 1.0}
light_source {<500, 500,-500> rgb 1}
camera {location<0, 1.6, -5.0> look_at<0,0,0>}

#declare Sd=seed(7)

#macro Rmm(Min,Max,Stream)
   Max+((Min-Max)*rand(Stream))
#end //macro

#declare XX= Rmm(0.1,0.5,Sd)
#debug concat("\n XX= ",str(XX,3,3))

#declare Wood= texture {
   pigment {rgb <0.50,0.10,0.08>*XX}
}
texture {
   pigment {
      wood
      scale 0.05
      color_map {
         [0,rgbf <0.5,0.4,0.4,0.2>*0.5]
         [1,rgbf <0.5,0.4,0.4,0.7>*0.5]
      }
   }
}
box {-1,1 texture {Wood}}


Post a reply to this message

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