POV-Ray : Newsgroups : povray.binaries.images : Rain Drops Server Time
14 Nov 2024 10:17:12 EST (-0500)
  Rain Drops (Message 1 to 1 of 1)  
From: Felbrigg
Subject: Rain Drops
Date: 3 Feb 2004 11:27:30
Message: <401fcbf2@news.povray.org>
For John who asked.  Heres how the rain was added...

// Join all rain drops intp one huge blobby object
#declare theDrops = object {

// Counter used to count each drop.
#declare dropCount=1;

// Declare the random stream seed ( where it starts in the random number
list ).
#declare rStream = seed(0);

       blob     {
                threshold 0.5

                // This "while" loop, loops until the count of drops reaches
786.
                #while(dropCount<786)

                        // The box i'm putting the drops on is <-10,0,-10>
to <10,-10,10> so for
                        // each drop get a random position in the x and z
within the boxes co-ords.
                        #declare xMod = (rand(rStream)*9)-4.5;
                        #declare zMod = (rand(rStream)*9)-4.5;

                        // Get a random size for the drop.
                        #declare dropSize = (rand(rStream) * 0.5)+0.01;

                        // Using the "trace" function to draw a line from
Y1000 to Y-1000 and return the
                        // location where the line intersects the box (the
top).
                        sphere  {
                                trace
(theBox,<xMod,1000,zMod>,<xMod,-1000,zMod> )
                                ,dropSize, strength 1
                                }

                        // Increment the count of drops by one, the parser
then goes back to the "while"
                        // to see if we've added 786.
                        #declare dropCount = dropCount + 1;
                #end

                // This scale reduces the height of the blobs spheres by
half, giving them a more
                // watery shape.
                scale <1,0.5,1>
                texture {
                        pigment {
                                Clear
                                }
                        finish  {
                                reflection { 0.1,0.8 }
                                }
                        }
                hollow
                interior        {
                ior Water_Ior
                                }
                }
}

And just so everyone knows.  The city was generated using the City macro by
Chris Colefax with a very minor bit of tinkering by myself.


Post a reply to this message


Attachments:
Download 'Rain drops.jpg' (120 KB)

Preview of image 'Rain drops.jpg'
Rain drops.jpg


 

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