POV-Ray : Newsgroups : povray.animations : Random Scale : Re: Random Scale Server Time
28 Jul 2024 18:17:28 EDT (-0400)
  Re: Random Scale  
From: Marc Schimmler
Date: 17 Mar 1999 08:30:20
Message: <36EFAE6B.8418D941@ica.uni-stuttgart.de>
Inexistencia-Design, Dec. P. Eventos Lda wrote:
> 
> Hello!
> I need to animate a cylinder by random scaling it up and down in y axis but
> a only want to scale from 0.9 to 1.1. How can I get a random number and get
> sure that falls between 0.9 and 1.1.
> I've tried with rand(seed(clock)) but can't get there.
> 
> Sergio

Hi Sergio!

I tried this and it worked the I I think you meant.

--------------------------------------------------------
camera {location <0,2,-2>
        look_at  0}

light_source {<1,1,-1> color rgb<1,1,1>}

#declare RAND1 = seed(12345+(clock*10));

cylinder {0,y,0.25 
          pigment{color rgb <1,0,0>}
          scale <1,0.9 + (0.2 * rand(RAND1)),1> }

--------------------------------------------------------

Marc
-- 
Marc Schimmler


Post a reply to this message

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