POV-Ray : Newsgroups : povray.text.scene-files : Golden Ratio Server Time
31 Oct 2024 10:24:11 EDT (-0400)
  Golden Ratio (Message 1 to 1 of 1)  
From: Alf Peake
Subject: Golden Ratio
Date: 30 Aug 2000 19:42:24
Message: <39ad9be0@news.povray.org>
/*
// Fibonacci or Golden numbers.  Make sun-flower head, pine-cones etc.
// One of many sources:
// http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fibnat.html
// Phi is approx 1.618
// phi = Phi-1 = (sqrt(5)-1)/2 = 0.61803399
// radius = sqrt(count), theta = count*360*phi degrees
// Use radius to modify other parameters such as seed size.

Alf

http://www.peake42.freeserve.co.uk/
http://ourworld.compuserve.com/homepages/Alf_Peake/
*/

#version 3.1;
global_settings { assumed_gamma 1 }
#include "colors.inc"

camera{ location y*14 angle 40 look_at 0 }
light_source { 50 1 }
#default{ finish{ phong 0.6 phong_size 100 diffuse 0.6} }
#declare phi= (sqrt(5)-1)/2;
#declare Inc = phi*360;
// First component's offset to avoid a messy center.
#declare Offset=0.5; // May also prevent a div_by_zero error

#declare MaxCount=1400;
#declare Count=0;
blob{ threshold 0.6
     #while (Count<MaxCount)
        #declare Rad = sqrt(Count+Offset)/10; // Scaler
        sphere{ z*Rad, 0.133, 1 rotate y*Count*Inc }
        #declare Count=Count+1;
     #end
   pigment{ Cyan }
   }

#declare Count=0;
union{
  #while (Count<MaxCount)
    #declare Rad = sqrt(Count+Offset)/10; // Scaler, sets sphere
separation
    sphere{ z*Rad, 0.1 rotate y*Count*Inc }
    #declare Count=Count+1;
  #end
  pigment{ Yellow }
  bounded_by{ box{ <-4,-0.2,-4>,<0,0.2,4>} }
  clipped_by { bounded_by }
}


Post a reply to this message

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