Re: Random points on a unit sphere without biasing

Date : Wed, 15 Jun 2005 10:13:09 +0100
To : XSI(at)Softimage.COM
From : Alan Jones <skyphyr(at)gmail.com>
Subject : Re: Random points on a unit sphere without biasing
Thanks All for the info. I think I best start doing some experimenting
to see how things are looking and then refine the method I use for
picking points from there.

Cheers,

Alan.

On 6/14/05, Andy Jones <andy(at)thefront.com> wrote:
> That's what the quasi-monte-carlo QMC algorithms do for you in Mental
> Ray, right?  mi_sample, for instance?  I'm not sure what happens to the
> even distribution once you pipe it through the Box-Muller transformation
> or whatever you're doing, though.  You could end up with some sort of
> biasing or undesirable jitter patterns.
> 
> -Andy
> 
> OO's mailbot wrote:
> 
> > You are probably after an "evenly distributed" placement rather than
> > truly random. You are likely to get better result faster by jittering
> > an even distribution of sample rather than creating an even distribution.
> >
> > This is the way stocastic sampling works. rather than randomly picking
> > points on a surface, you start by picking uniformaly distributed
> > points and offset them slightly to break up the pattern.
> >
> > Most of what we call "random" in natural patterns are actually caused
> > by cellular or molecular diffusion and are really not random at all
> > but a stable system of attraction/repulsion. ie every point is spaced
> > out more or less evenly across the surface, so that you never have
> > points that are clustered too close or too far away from each other.
> > With a very very high sample a random distribution will approximate
> > that, but you have no controls over overlapping samples with a random
> > number generator...
> >
> > oO
> >
> > On Jun 15, 2005, at 7:11 AM, kim aldis wrote:
> >
> >> True.
> >>
> >> A Gaussian distribution would concentrate the generated points
> >> towards the
> >> centre so you'd have fewer outside the sphere. Not perfect but a deal
> >> better.
> >>
> >> <trivia>
> >> Gaussian distribution just requires averaging a number of random
> >> numbers.
> >> The average of an infinite number of random numbers between lying
> >> between -1
> >> and 1 is zero. I once knew a Cambridge graduate mathematician who
> >> couldn't
> >> get that.
> >> </trivia>
> >>
> >>
> >>> -----Original Message-----
> >>> From: owner-xsi(at)Softimage.COM
> >>> [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Alan Jones
> >>> Sent: 14 June 2005 21:58
> >>> To: XSI(at)Softimage.COM
> >>> Subject: Re: Random points on a unit sphere without biasing
> >>>
> >>> X, Y, Z ones would be the same as doing a cube getting more
> >>> in the corners. Apparently gaussian is special... At least
> >>> that's what I assume from what I read on the mathworld page.
> >>>
> >>> Cheers,
> >>>
> >>> Alan.
> >>>
> >>> On 6/14/05, kim aldis <kim(at)aldis.org.uk> wrote:
> >>>
> >>>> Why Gaussian? Wouldn't normalising x/y/z random  numbers work?
> >>>>
> >>>>
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: owner-xsi(at)Softimage.com
> >>>>> [mailto:owner-xsi(at)Softimage.com] On Behalf Of Alan Jones
> >>>>> Sent: 14 June 2005 21:42
> >>>>> To: XSI(at)Softimage.com
> >>>>> Subject: Re: Random points on a unit sphere without biasing
> >>>>>
> >>>>> Thanks Andy. After looking at the options I think I'm going to go
> >>>>> with the one at the bottom of the mathworld page. It suggested 3
> >>>>> gaussian random numbers for X, Y and Z in a vector and
> >>>>
> >>> normalizing
> >>>
> >>>>> the vector (at least that's what I think it said from my limited
> >>>>> math). I managed to track down an apparently fast way to generate
> >>>>> gaussian random numbers from evenly distributed ones so with any
> >>>>> luck I'm set.
> >>>>>
> >>>>> Thanks again,
> >>>>>
> >>>>> Alan.
> >>>>>
> >>>>> On 6/14/05, Andy Jones <andy(at)thefront.com> wrote:
> >>>>>
> >>>>>> The mathworld article answers this perfectly.  Basically,
> >>>>>
> >>>>> you pick one
> >>>>>
> >>>>>> angle (theta) at random and a height (h) on the sphere at
> >>>>>
> >>>>> random.  You
> >>>>>
> >>>>>> can check this by calculating the approximated surface
> >>>>>
> >>> area (width
> >>>
> >>>>>> *
> >>>>>> radius) of the bands around the sphere at different heights
> >>>>>
> >>>>> along the
> >>>>>
> >>>>>> sphere, and take the limit as dh -> 0.  At the poles, the
> >>>>>
> >>>>> width of the
> >>>>>
> >>>>>> band is larger for a given height, and at the equator, the
> >>>>>
> >>>>> radius of
> >>>>>
> >>>>>> the band is obviously larger.  In the limit, they have
> >>>>>
> >>> a perfectly
> >>>
> >>>>>> inverse relationship such that each band has the same
> >>>>>
> >>> area.  More
> >>>
> >>>>>> generally, a good way to randomly sample vectors within a
> >>>>>
> >>>>> given angle
> >>>>>
> >>>>>> of an average vector is to restrict the height range to
> >>>>>
> >>>>> [cos(angle), 1].
> >>>>>
> >>>>>>
> >>>>>> I think you can't pick points in a cube and normalize
> >>>>>
> >>>>> because you'll
> >>>>>
> >>>>>> bias more points at the corners and fewer points in the
> >>>>>
> >>>>> middles of the
> >>>>>
> >>>>>> faces, since a cube has more and less volume in those
> >>>>>
> >>>>> directions.  The
> >>>>>
> >>>>>> same problem occurs if you sample on a cube's surface area.
> >>>>>
> >>>>>  The cube
> >>>>>
> >>>>>> method is especially problematic because the biasing isn't
> >>>>>
> >>>>> determined
> >>>>>
> >>>>>> by the original vector direction.  Of course, that
> >>>>>
> >>> doesn't mean it
> >>>
> >>>>>> doesn't work okay in practice for many applications.
> >>>>>>
> >>>>>> -Andy
> >>>>>>
> >>>>>> Alan Jones wrote:
> >>>>>>
> >>>>>>> Hi All,
> >>>>>>>
> >>>>>>> This is to the maths geniuses in the room. I want to
> >>>>>>
> >>> generate X
> >>>
> >>>>>>> number of points on a unit sphere, but be sure I won't
> >>>>>>
> >>> have any
> >>>
> >>>>>>> biasing involved.
> >>>>>>>
> >>>>>>> My first thought was just to use a couple of random numbers
> >>>>>>> (let's assume they don't have any bias) and then use
> >>>>>>
> >>> those with a
> >>>
> >>>>>>> few sin and cos function etc to generate the points. Though I
> >>>>>>> have
> >>>>>>
> >>>>> a feeling
> >>>>>
> >>>>>>> that would give me more points around the poles.
> >>>>>>>
> >>>>>>> Anyone have some good suggestions?
> >>>>>>>
> >>>>>>> Cheers,
> >>>>>>>
> >>>>>>> Alan.
> >>>>>>>
> >>>>>>> ---
> >>>>>>> Unsubscribe? Mail Majordomo(at)Softimage.COM with the
> >>>>>>
> >>>>> following text in body:
> >>>>>
> >>>>>>> unsubscribe xsi
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>> ---
> >>>>>> Unsubscribe? Mail Majordomo(at)Softimage.COM with the
> >>>>>
> >>>>> following text in body:
> >>>>>
> >>>>>> unsubscribe xsi
> >>>>>>
> >>>>>
> >>>>> ---
> >>>>> Unsubscribe? Mail Majordomo(at)Softimage.COM with the
> >>>>
> >>> following text in
> >>>
> >>>>> body:
> >>>>> unsubscribe xsi
> >>>>>
> >>>>>
> >>>>
> >>>> ---
> >>>> Unsubscribe? Mail Majordomo(at)Softimage.COM with the
> >>>
> >>> following text in body:
> >>>
> >>>> unsubscribe xsi
> >>>>
> >>>
> >>> ---
> >>> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following
> >>> text in body:
> >>> unsubscribe xsi
> >>>
> >>>
> >>
> >> ---
> >> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> >> body:
> >> unsubscribe xsi
> >
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> > body:
> > unsubscribe xsi
> >
> 
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.