POV-Ray : Newsgroups : povray.text.scene-files : trendy sphere sweep Server Time
23 Dec 2024 09:10:50 EST (-0500)
  trendy sphere sweep (Message 1 to 1 of 1)  
From: nospam
Subject: trendy sphere sweep
Date: 4 Jun 2002 21:37:42
Message: <3cfd6a7d.12436403@localhost>
Source to an image posted in the images newsgroup
povray 3.5 only.


-- 
#version 3.5;


#declare rseed = seed(14110948);


camera {
  orthographic
  location 0
  direction <0, 0, 1>
  right <(image_width / image_height), 0, 0>
  up <0, 1, 0>
  translate <0, 0, -10>
}


#declare main_texture = texture {
  pigment { color rgb <0.9, 0.95, 1> }
  finish { ambient 0.5 diffuse 0.5 }
}


plane { // back wall
  <0, 0, -1>, -0.2
  pigment {
    planar
    color_map {
      [ 0.79 color rgb 0.83 ]
      [ 0.79 color rgb 0.7 ]
      [ 0.8 color rgb 0.7 ]
      [ 0.8 color rgb 0.9 ]
    }
  }
  finish { ambient 0.8 diffuse 0.2 }
}


#macro one_t(put_here, t_scale)
  #local t_base_rad = 0.4;
  #local num_steps = 3 + int(rand(rseed) * 3);
  #local x_offset = 0.9 + (rand(rseed) * 0.2);
  sphere_sweep {
    cubic_spline
    num_steps + 2, // number of spheres
    <1, 0, 0>, t_base_rad, // first point, never seen
    #local xx = 0;
    #if (rand(rseed) > 0.5)
      #local tphase = -1;
    #else
      #local tphase = 1;
    #end
    #local tphase = tphase * (0.8 + (0.4 * rand(rseed)));
    #while (xx < num_steps)
      #local t_rad = ((num_steps - xx - 1) / num_steps) * t_base_rad; 
      <
        (-2 * xx) + (rand(rseed) * 0.4) * x_offset,
        tphase * (0.3 + (t_rad * 0.7)) + (rand(rseed) * 0.2 - 0.1),
        0
      >, t_rad,
      #local xx = xx + 1;
      #local tphase = tphase * -1;
    #end
    <-2 - 2 * num_steps, 0, 0>, 0 // last point, not seen
    scale t_scale
    scale 1.0 + (0.06 - (0.12 * rand(rseed)))
    translate put_here
  }
#end


union {
  union {
    sphere { 0, 0.14 }
    one_t(<-0.05, 0, 0.05>, 0.11)
    one_t(<-0.05, 0, -0.05>, 0.11)
    one_t(<-0.05, 0, 0>, 0.11)
    texture { main_texture }
  }
  intersection {
    sphere { 0, 0.1405 }
    union {
      #declare rotx = 0;
      #while (rotx < 180)
        box {
          <-0.01,  0.014,  1>,
          < 0.01, -0.014, -1>
          rotate x*rotx
        }
        #declare rotx = rotx + (180 / 12);
      #end
    }
    pigment { color rgb <0.9, 0.95, 1> * 0.9 }
    finish { ambient 0.6 diffuse 0.4 }
  }
  translate <0.3, 0, 0>
}


light_source {
  <0, 0, -3000>
  color rgb 1
  area_light <100, 0, 0>, <0, 100, 0>, 5, 5 adaptive 1
  rotate x*12
  rotate y*-12
}


/* actual end of this file */


-- 
Note: peterc@nym... e-mail is gone.  Now at ikd### [at] sneakemailcom


Post a reply to this message

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