POV-Ray : Newsgroups : moray.win : Equally distributed lights Server Time
28 Jul 2024 18:16:47 EDT (-0400)
  Equally distributed lights (Message 1 to 6 of 6)  
From: Charles
Subject: Equally distributed lights
Date: 14 Apr 2000 13:53:03
Message: <38f75aff@news.povray.org>
How can I build an array of equally ditributed point lights? They have to be
on the surface of a sphere.
Perhaps I would have a better chance in POV directly, but I havn't found a
formula.

Thanks,
-C-H-A-R-L-E-S-


Post a reply to this message

From: Warp
Subject: Re: Equally distributed lights
Date: 17 Apr 2000 03:02:33
Message: <38fab709@news.povray.org>
Charles <101### [at] germanynetde> wrote:
: How can I build an array of equally ditributed point lights? They have to be
: on the surface of a sphere.

  I don't think there's any way of doing this kind of thing in moray (unless
you make your own plugin).

: Perhaps I would have a better chance in POV directly, but I havn't found a
: formula.

  The problem of distributing points (approximately) evenly on the surface
of a sphere is not trivial. Only certain amounts of points have an exact
solution. Other amounts have to use only an approximation.
  Usually an approximation is good enough. If so, you can use this algorithm:

#declare Spread = .1;
#declare mintheta = 0;
#declare maxtheta = pi;

camera { location <-4,1,-6>*.7 look_at 0 angle 35 }
light_source { <50,100,-200> 1 }

#declare dtheta = atan2(Spread,1);

#declare R=seed(0);
#declare theta=mintheta;
#while(theta<maxtheta)
  #if(theta=0)
    #declare dphi=2*pi;
  #else
    #declare dphi=dtheta/sin(theta);
  #end
  #declare minphi= -pi + dphi*rand(R)*.5;
  #declare maxphi= pi - dphi/2 + (minphi+pi);
  #declare phi=minphi;
  #while(phi<maxphi)
    sphere
    { z,.05
      rotate x*degrees(theta)
      rotate z*degrees(phi)
      pigment { rgb x } finish { specular .5 }
    }
    #declare phi=phi+dphi;
  #end
  #declare theta=theta+dtheta;
#end


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Rick [Kitty5]
Subject: Re: Equally distributed lights
Date: 17 Apr 2000 03:30:17
Message: <38fabd89@news.povray.org>
Wont a couple of cunningly positioned area lights do instead?

Rick


Post a reply to this message

From: Warp
Subject: Re: Equally distributed lights
Date: 17 Apr 2000 05:18:07
Message: <38fad6cf@news.povray.org>
Or better use the circular area light with orient-property in MegaPov.
The effect will be a spherical area light.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Rick [Kitty5]
Subject: Re: Equally distributed lights
Date: 18 Apr 2000 05:58:45
Message: <38fc31d5@news.povray.org>
Replying to my own post... *sigh*

i have seen some 3d tutorials that suggest the use of spherical area lights,
or even a mess of dim regular lights arranged in a vaguly sphereical patern.

if better lighting is your mission, then 2 area lights aranged in a cross
pattern (on lined with Y the other with Z for example) will produce an
almost identical effect (and not kill your render time)

Rick


Post a reply to this message

From: Charles
Subject: Re: Equally distributed lights
Date: 18 Apr 2000 14:41:10
Message: <38fcac46@news.povray.org>
Hi Warp and Rick,

Thanks for your replies.
I guessed this is not trivial.  I'll give the area lights a try because of
the render time.

-C-H-A-R-L-E-S-

Warp <war### [at] tagpovrayorg> schrieb in im Newsbeitrag:
38fab709@news.povray.org...
> Charles <101### [at] germanynetde> wrote:
> : How can I build an array of equally ditributed point lights? They have
to be
> : on the surface of a sphere.
>
>   I don't think there's any way of doing this kind of thing in moray
(unless
> you make your own plugin).
>
> : Perhaps I would have a better chance in POV directly, but I havn't found
a
> : formula.
>
>   The problem of distributing points (approximately) evenly on the surface
> of a sphere is not trivial. Only certain amounts of points have an exact
> solution. Other amounts have to use only an approximation.
>   Usually an approximation is good enough. If so, you can use this
algorithm:
>
> #declare Spread = .1;
> #declare mintheta = 0;
> #declare maxtheta = pi;
>
> camera { location <-4,1,-6>*.7 look_at 0 angle 35 }
> light_source { <50,100,-200> 1 }
>
> #declare dtheta = atan2(Spread,1);
>
> #declare R=seed(0);
> #declare theta=mintheta;
> #while(theta<maxtheta)
>   #if(theta=0)
>     #declare dphi=2*pi;
>   #else
>     #declare dphi=dtheta/sin(theta);
>   #end
>   #declare minphi= -pi + dphi*rand(R)*.5;
>   #declare maxphi= pi - dphi/2 + (minphi+pi);
>   #declare phi=minphi;
>   #while(phi<maxphi)
>     sphere
>     { z,.05
>       rotate x*degrees(theta)
>       rotate z*degrees(phi)
>       pigment { rgb x } finish { specular .5 }
>     }
>     #declare phi=phi+dphi;
>   #end
>   #declare theta=theta+dtheta;
> #end
>
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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