POV-Ray : Newsgroups : povray.text.scene-files : Recursive cones Server Time
31 Oct 2024 19:30:52 EDT (-0400)
  Recursive cones (Message 1 to 1 of 1)  
From: Larry Fontaine
Subject: Recursive cones
Date: 1 Sep 1999 23:58:42
Message: <37CDF188.AF6FB807@isd.net>
My Cones macro form the cones image I posted.
Usage: cones(X,Z,R,H,D,Rr,Hr,Dr,N,L)
    X-- x location of main cone
    Z-- z location of main cone
    (outputted cones always rest on x-z plane)
    R-- radius of main cone
    H-- height of main cone
    D-- distance from main cone to level-two cone
    Rr-- ratio of radii on parent and child cones
    Hr-- ratio of height on parent and child cones
    Dr-- ratio of distances between parent and child cones on successive
iterations
    N-- number of children cones for each parent
    L-- level of recursion
Why so many param's? Hard to tweak... took a little time for me to get
non-intersecting cones that were evenly spaced between the edges of the
parent and grandparent cones (for ones on the inside). Although Dr
certainly is unneccesary once you think about it... (should be same as
Hr or it's not really a fractal)


#macro cones (X,Z,R,H,D,Rr,Hr,Dr,N,L)
cone { <X,0,Z>,R <X,H,Z>,0 }
#local C = 0;
#if (L > 1)
   #while (C < N)
      cones
(sin(C/N*2*pi)*D+X,cos(C/N*2*pi)*D+Z,R*Rr,H*Hr,D*Dr,Rr,Hr,Dr,N,L-1)
      #declare C = C + 1;
   #end
#end
#end


Post a reply to this message

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