POV-Ray : Newsgroups : povray.general : Help with a spherical container : Re: Help with a spherical container Server Time
4 Aug 2024 02:22:12 EDT (-0400)
  Re: Help with a spherical container  
From: Christopher James Huff
Date: 5 Nov 2003 15:31:29
Message: <cjameshuff-DC95CA.15311505112003@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 Alain <noe### [at] onca> wrote:

> Sorry condescending dude,

What you said was incorrect, so I corrected you. There's no reason to be 
insulting.


> but I have no idea what you are talking about. 
> What subtraction do you have a problem with?  The -1?  It establishes a 
> range -1 to +1.

Bleh, I was misreading 1+rand(S) as 1-rand(S).


>  You have a problem with the 1+? It's a simple inversely 
> proportional equation.  Besides I just tried it in Pov and it seems to 
> work fine.  Yes, it's not an even distribution, it favours points towards 
> the outside (but not outside), which was intended in that one. 

It is more than uneven: 5/(1+rand(S)) will range between 5 and 2.5. The 
interior of the sphere will be empty...you end up filling a hollow shell 
with inner radius 2.5 and outer radius 5. And within this shell, it will 
still be more dense toward the inner side of the shell than the outer 
side.


> And, yes, even the second equation I gave, as pointed out by Warp, 
> will only distribute randomly radially.

This one?
5*rand(S)*vnormalize(-1+2*<rand(S),rand(S),rand(S)>)

That distribution is not even in any way. Points will be more dense 
facing the corners of the cube you pull random points from, so the 
distribution is uneven in angular density. A cone from the center 
pointing at < 1, 1, 1> will contain more points than the same cone 
pointing at < 0, 0, 1>.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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