POV-Ray : Newsgroups : povray.newusers : mapping spheres onto a sphere....liposome : Re: mapping spheres onto a sphere....liposome Server Time
29 Jul 2024 02:27:46 EDT (-0400)
  Re: mapping spheres onto a sphere....liposome  
From: Trevor G Quayle
Date: 26 Jan 2007 15:00:00
Message: <web.45ba5cd1a6cc4078c150d4c10@news.povray.org>
"Chemgirl" <nomail@nomail> wrote:
> PLEASE help!!!!
> thanks in advance!

Here is a scene using a macro I wrote a while back for geodesic packing.  As
you increase the n-value, the number of spheres becomes exponentially more
(and so does parsing and rendering.  Feel free to use this or modify it if
is of use to you.

Geodesic(n,R,Obj)
n=subdivision level
R=radius of geodesic shpere
Obj=object to place geodesically


//START
camera{
  up y
  right x*image_width/image_height
  angle 30
  location <0,0,-1000>
  look_at  0
}



light_source{<0,1000,-1000>
  rgb 1
}

#macro Geodesic(n,R,Obj)
  union{
    #if (n=0)
      object{Obj}
    #else
      #local nL=pow(2,(n-1));
      #local i=-nL;
      #while (i<=nL)
        #local nS=4*(nL-abs(i));
        #if (nS=0)
            object{Obj translate<0,0,-R> rotate x*i*90/nL}
        #else

          #local j=0;
          #while (j<nS)
            object{Obj translate<0,0,-R> rotate x*i*90/nL rotate y*j*360/nS}
            #local j=j+1;
          #end

        #end
        #local i=i+1;
      #end
    #end
  }
#end



#declare SP=sphere{0,6 pigment{rgb 1}}

object{Geodesic(5,100,SP)}
//START



-tgq


Post a reply to this message

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