POV-Ray : Newsgroups : povray.unofficial.patches : Spiral pattern with uniform angular density : Re: Spiral pattern with uniform angular density Server Time
2 Sep 2024 20:20:31 EDT (-0400)
  Re: Spiral pattern with uniform angular density  
From: Nathan Kopp
Date: 21 Jul 1999 23:31:17
Message: <3796911B.49D57671@Kopp.com>
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

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