POV-Ray : Newsgroups : povray.binaries.images : Done before... [185kbu] : Re: Done before... [185kbu] Server Time
15 Aug 2024 16:29:31 EDT (-0400)
  Re: Done before... [185kbu]  
From: Børge Berg-Olsen
Date: 25 May 2002 04:54:11
Message: <3CEF50C8.C4F3E6C2@dod.no>
Rich wrote:
> 

> 
> > ... with a different twist this time. Original macro/source by Rich
> > Allen <ric### [at] ricoswebcom> I've only added phi to the equation:
> >
> > #declare phi = (sqrt(5)-1)/2; // The golden ratio
> 
> Hey, neat!  I haven't played with this code in a while, can you post your
> source so I can see how you've used phi in the equation?

I only subsituted your #declare rad with #declare phi, and by doing that
the spiral automagically became what you see in the image, but with only
one call to the macro, wher you had three and two of the three were
rotated.

// Original bit by Rich Allen <ric### [at] ricoswebcom>
// I've only added phi to the equation

#declare phi	  = (sqrt(5)-1)/2; // The golden ratio
#declare dots     = 168;           // number of spheres in spiral
#declare rstart   = 5;             // starting radius of spiral
#declare rstop    = 0;             // ending radius of spiral
#declare loops    = 1;             // number of times spiral circles the
center
#declare cirstart = 0.3;           // starting radius of the spheres
(outer sphere)
#declare cirstop  = .05;           // ending radius of the spheres
(inner sphere)

#declare tdegs = 360*loops;
#declare dstep = 360/dots;
#declare rstep = (rstart-rstop)/(tdegs/dstep);
#declare cstep = (cirstart-cirstop)/(tdegs/dstep);
#declare r1 = rstart;
#declare c1 = cirstart;
#declare y1 = c1;
#declare deg=1;

#declare spiral = union {
  #while (deg < tdegs)
    #declare x1 = r1*cos(deg*phi);
    #declare z1 = r1*sin(deg*phi);
    sphere { <x1,y1,z1>, c1
    #if(!FastTexture) 
		material { M_Glass }
		
		photons {  // photon block for an object
			target 1.0
			refraction on
			reflection on
		}
    #end
    #if(FastTexture)
    	texture { fastTex }
    #end	
    }
    #declare c1 = c1 - cstep;
    #declare r1 = r1 - rstep;
    #declare y1 = c1;
    #declare deg=deg+dstep;
  #end 
}

object {
  #object {spiral}
  translate <0,0,2.5>
}


-- 

------------------------------------------------------------------------
  +47 90 62 71 78          DoD#2101, DoDRT#017, NIC#015, PJ#006, OGM#007
  azo### [at] dodno, Ducati M600, Clementine  Ubesudlet: Aldri eid en J&%#PS.


Post a reply to this message

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