POV-Ray : Newsgroups : povray.newusers : random elements in blob object : random elements in blob object Server Time
4 Nov 2024 17:42:58 EST (-0500)
  random elements in blob object  
From: koos
Date: 2 Feb 2002 02:30:37
Message: <01c1abbb$9437bf40$667dd383@etnica>
Hello all, 

I am trying to create a blob object with a number of sphere, but I am
trying to place them at random. Now the following problem occurs, all
sphere are placed at the same position. The objection, of course, is to see
all the spheres. My code is as follows:

#declare bubbles = blob
{
  threshold 0.5
  #declare i = 0;
  #while (i<50)
    #declare S = seed(3415765);
    #declare X = rand(S);
    #declare Y = (rand(S)*2)+0.5;
    #declare Z = rand(S);
    sphere { <X, Y, Z>, 0.4, 0.55
      pigment { color rgb <0.8, 0.3, 0.6> }
    }
    #declare i = i + 1;
  #end
}

Any help would be appreciated, 
Koos Jan Niesink


Post a reply to this message

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