|
|
If your grab the paper on my page (postscript format) it has the formula.
It's not really a spiral.... it's actually a series of rings but if you
were to animate the process it would look like it was spiraling out.
Part of the 'for' loop is show below. photonSpread is the average
distance between photons at a distance of one unit from the light source
(if I did the math correctly). mintheta is always 0 and maxtheta
depends on the size of the object being shot at.
I have also successfully used this formula to place mirrors on a disco
ball in a POV #while loop.
dtheta = atan(photonOptions.photonSpread);
for(theta=mintheta; theta<maxtheta; theta+=dtheta)
{
photonOptions.hitObject = FALSE;
if (theta<EPSILON)
dphi=2*M_PI;
else
dphi=dtheta/sin(theta);
minphi = -M_PI + dphi*FRAND()*0.5; /* add a bit of jitter */
maxphi = M_PI - dphi/2 + (minphi+M_PI);
for(phi=minphi; phi<maxphi; phi+=dphi)
{
/*
theta is the azimuthal angle - zero means shooting directly at
the object
phi rotates around the point-at axis
*/
}
}
-Nathan
Nieminen Mika wrote:
>
> Not really a patch or even a povray question but...
>
> In the photon patch help we can read that "photons are shot in a spiral
> pattern with uniform angular density".
> What is the formula for this spiral pattern?
>
> ie. suppose that I want to place spheres in a spiral so that the distance
> between the nearest spheres is approximately the same.
>
> --
> 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
|
|