POV-Ray : Newsgroups : povray.text.scene-files : candycorns Server Time
23 Dec 2024 15:24:21 EST (-0500)
  candycorns (Message 1 to 1 of 1)  
From: Pete
Subject: candycorns
Date: 30 Sep 2000 16:58:55
Message: <1663.306T2381T13105570PeterC@nym.alias.net>
Pov file to fill the screen with candy corns.  Enjoy

-- 
/* candy corn?? */
#declare rseed = seed(43781956);
#declare ntsc = false;
#declare b_color = 0;  /* background color */


camera {
  location <0, 0, 0>
  direction <0, 0, 2.6>
  up <0, 1, 0>
  #if (ntsc = true)
    right <(640 / 400) * (10/11), 0, 0>
  #else
    right <(640 / 480), 0, 0>
  #end
  translate <0, 0, -20>
}


#macro rnd_rotate()
  rotate <360 * rand(rseed), 360 * rand(rseed), 360 * rand(rseed)>
#end


#macro rnd_translate()
  translate <4 - 8 * rand(rseed), 4 - 8 * rand(rseed), 4 - 8 * rand(rseed)>
#end


#macro perturb()
  rnd_translate()
  rnd_rotate()
#end


background { color rgb b_color }


#declare c_corn = union {
  torus { 1, 0.5 translate <0, 0.5, 0> }
  cylinder { <0, 0, 0>, <0, 0.1, 0>, 1 }
  cone { <0, 0.7, 0>, 1.457, <0, 2.67, 0>, 0.47 }
  sphere { <0, 2.5, 0>, 0.5 }
  pigment {
    gradient <0, 1, 0>
    scale 3.1
    translate <0, -0.05, 0>
    color_map {
      [ 0.27 color rgb <0.9, 0.5, 0.1> ]
      [ 0.37 color rgb <1, 1, 0.2> ]
      [ 0.66 color rgb <1, 1, 0.2> ]
      [ 0.79 color rgb 1 ]
    }
  }
  finish { ambient 0.5 diffuse 0.5 }
  scale <2/3, 1, 1/3>
}


#declare cc = 0;
#while (cc < 700)
  #declare randx = 6 - 12 * rand(rseed);
  #declare randy = 4 - 8 * rand(rseed);
  #declare randz = 3 * rand(rseed);
  object {
    c_corn
    //rnd_rotate()
    rotate x*(5 - 10 * rand(rseed))
    rotate z*360*rand(rseed)
    scale 1/4
    translate <randx, randy, randz>
  }
  #declare cc = cc + 1;
#end


light_source {
  <1000, 1000, -3000>
  color rgb 0.6
}
light_source {
  <-400, 904, -3000>
  color rgb 0.6
}


/* actual end of this file */


Post a reply to this message

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