POV-Ray : Newsgroups : povray.binaries.images : A sphere (or two) and a checkered floor : Re: A sphere (or two) and a checkered floor Server Time
9 Aug 2024 01:26:27 EDT (-0400)
  Re: A sphere (or two) and a checkered floor  
From: PM 2Ring
Date: 8 Apr 2005 13:25:02
Message: <web.4256b85a79b43b9299ddb8130@news.povray.org>
Here's a group of coloured shells arranged using my colour-wheel algorithm.

//POV-Ray 3.1+ Scene File. Pickover shell colourwheel.
#include "colors.inc"

global_settings{max_trace_level 39 assumed_gamma 1}

#declare N=99;#declare K=.75;#declare A=-2;#declare D=(11/3-A)/N;
#declare B=.15;#declare C=.35/B; light_source{<2,4,-8>rgb 1.3}

#declare Shell=union{#declare I=1;#while(I<=N)
#declare T=I/N;#declare TH=A*2*pi;#declare R=B*exp(A*K);
sphere{<R*cos(TH),R*sin(TH),C*R>,R
//pigment{rgb<T,.6,1-T*T>}
}#declare I=I+1;#declare A=A+D;
#end rotate x*9 translate<0,3,9>}

#declare Num = 6;        //Number of circles
#declare Sectors = 6;    //Must be 2, 3 or a multiple of 6. If you change
this from 6,
                         //other adjustments may be desirable ...
#declare LoHue = 30;
#declare HiHue = 200;

#declare LoSat = 0.35;
#declare HiSat = 1.0;

#declare LoVal = 0.2;
#declare HiVal = 1.0;

#macro interp(Lo, Hi, q)
  (Lo + (Hi-Lo)*q)
#end

#declare Rad=R*1.65;
union{
#declare J=1;
#while (J<Num)
  #declare Val = interp(LoVal, HiVal, (J-1)/(Num-2));

  #declare K=0;
  #while (K<Sectors)
    #declare Hue = interp(LoHue, HiHue, K/(Sectors-1));

    #declare DZ=2*z*(J+1) * Rad;
    #declare I=0;
    #while (I<=J)

      #declare Sat = interp(LoSat, HiSat, I/J);
      object{
        Shell rotate 180*y scale .65
        pigment{rgbft CHSV2RGB(<Hue, Sat, Val, 0,0>)}
        //pigment{rgb 1}
        finish{phong .7 reflection {0,1}}

        translate DZ
        rotate y*360*(K+I/(J+1))/Sectors
      }
      #declare I=I+1;
    #end
    #declare K=K+1;
  #end
  #declare J=J+1;
#end

  plane{y,0 pigment{checker rgb 0 rgb 1 scale 10 rotate
45*y}finish{reflection 1 ambient 0}}

  translate <0, -30, 65>
  rotate -x*35
}


Post a reply to this message


Attachments:
Download 'shellquick3.png' (666 KB)

Preview of image 'shellquick3.png'
shellquick3.png


 

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