POV-Ray : Newsgroups : povray.general : Help with a spherical container : Re: Help with a spherical container Server Time
4 Aug 2024 02:23:19 EDT (-0400)
  Re: Help with a spherical container  
From: Tom Melly
Date: 5 Nov 2003 10:22:45
Message: <3fa915c5$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3fa90775@news.povray.org...
> Alain <noe### [at] onca> wrote:
> > But, given that a sphere will have a higher concentration of points near
> > the center, I thought you might prefer to place them inversely
> > proportional to the distance from the center.
>
>   I think that the idea was to place random points *evenly* inside the
> sphere. Making a higher concentration near the center kind of defies
> this goal.
>

Ignoring any possible mis-terms, doesn't Alain's suggestion make sense?

Hmm, testing.... (with my disk-example)...

#include "colors.inc"

#declare MyRadius = .50;
camera {
  location  <0.0, 0.0, -MyRadius*2.5>
  look_at   <0.0, 0.0,  0.0>
}


disc {
  <0, 0, 0>  // center position
  z,         // normal vector
  MyRadius,       // outer radius
  0.0        // optional hole radius
  pigment{Red}
  finish{ambient 1}
}

#local Count = 0;
#local MyRand = seed(457);
#while(Count<10000)
  sphere{
    0,0.01*MyRadius
    translate y*(sqrt(rand(MyRand))*MyRadius)
    rotate z*360*rand(MyRand)
    pigment{Green}
    finish{ambient 1}
  }
  #local Count = Count +1;
#end

Well, that seems to produce a fairly even distribution.... I dunno how you apply
this to 3 dimensions (i.e. a sphere), but it can't be that hard, can it?


Post a reply to this message

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