POV-Ray : Newsgroups : povray.text.scene-files : GlassSpheres source Server Time
3 Jul 2024 02:19:36 EDT (-0400)
  GlassSpheres source (Message 1 to 1 of 1)  
From: Rich
Subject: GlassSpheres source
Date: 29 Apr 2001 17:09:24
Message: <Xns90929A2FB2370spammindspringcom@204.213.191.228>
See post with similar title in p.b.i.  I have turned off word-wrap in
my news reader to (hopefully) make it easier to cut-and-paste this
code into MegaPOV.  Again, credit for the lighting, textures, and
photon settings got to Warp (I hope, if not, please let me know).
  I re-arranged and tweaked some of the code, and added the routine
at the end that creates the spheres in a spiral pattern.  The code
I wrote is free to use, but if you think of it (and can remember my
name, I'm so embarassed that I can't remember who posted the textures
originally!) a little attribution would be cool.


------------------8<---------------------------------
#version Unofficial MegaPov 0.7;

global_settings {
  max_trace_level 50
  photons {count 200000 autostop 0}
}

camera { location <-2,3,-4> right 4/3*x look_at 0 }

light_source {
  <4,5,-5> rgb 2.5
  fade_distance 5 fade_power 2
  area_light x,y,5,5 adaptive 0 jitter orient
}

light_source {
  <0,3.5,5> rgb <60/255,60/255,90/255>*2.5
  fade_distance 5 fade_power 3
  area_light x,y,5,5 adaptive 0 jitter orient
}

sky_sphere { pigment {rgb <.6,.8,1>}}

plane
{ y,0
  pigment { rgb 1 }
  finish { ambient 0 diffuse 0.5 specular .4 roughness .01 reflection .2 }
}

#declare fastTex = texture { pigment { color rgb .5 } }

#declare glassTex = texture{
  pigment { rgbf <.95,.95,.95,.98>}
  finish { ambient 0 diffuse 0.0 specular 1 roughness 0.005 conserve_energy
reflection_type 1}
}

#declare glassInt = interior{ 
  ior 1.67 
  media { 
    method 3 
    absorption 2.8 
    density{ 
      wrinkles 
      color_map {[0 rgb 1-<1,.7,.7>][.33 rgb 1-<.7,1,.7>][.66 rgb 1-<.7,.7,1>]} 
      scale .6
    }
  }
}

//original bit by me starts here
#declare rad      = 0.017453292; //radians constant
#declare dots     = 21;          //number of spheres in spiral
#declare rstart   = 3;           //starting radius of spiral
#declare rstop    = 0;           //ending radius of spiral
#declare loops    = 1;           //number of times spiral circles the center
#declare cirstart = .4;          //starting radius of the spheres (outer sphere)
#declare cirstop  = .05;         //ending radius of the spheres (inner sphere)

#declare tdegs = 360*loops;
#declare dstep = 360/dots;
#declare rstep = (rstart-rstop)/(tdegs/dstep);
#declare cstep = (cirstart-cirstop)/(tdegs/dstep);
#declare r1 = rstart;
#declare c1 = cirstart;
#declare y1 = c1;
#declare deg=1;

#declare spiral = union {
  #while (deg < tdegs)
    #declare x1 = r1*cos(deg*rad);
    #declare z1 = r1*sin(deg*rad);
    sphere { <x1,y1,z1>, c1 texture {glassTex} interior{glassInt} photons {target
reflection on refraction on} /*texture{fastTex}*/ }
    #declare c1 = c1 - cstep;
    #declare r1 = r1 - rstep;
    #declare y1 = c1;
    #declare deg=deg+dstep;
  #end 
}

union {
  #object {spiral}
  #object {spiral rotate <0,120,0>}
  #object {spiral rotate <0,240,0>}
  sphere { <0,y1,0>, c1 texture {glassTex} interior{glassInt} photons {target
reflection on refraction on} /*texture{fastTex}*/ }
  translate <.5,0,.5>
}

------------------8<---------------------------------

-- 
Rich Allen
(Remove SPAM from my address to reply by e-mail)


Post a reply to this message

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