POV-Ray : Newsgroups : povray.text.scene-files : The Spectral Orb (you need the dispersion patch) Server Time
29 Jul 2024 00:32:36 EDT (-0400)
  The Spectral Orb (you need the dispersion patch) (Message 1 to 1 of 1)  
From: Peter Popov
Subject: The Spectral Orb (you need the dispersion patch)
Date: 14 Jan 1999 22:09:57
Message: <36a0afde.1260872@news.povray.org>
Here's the code for my Spectral Orb thingy I posted a couple of days
ago. You will need the dispersion patch by Daren Scot Wilson.

--------------- code starts ---------------------

// The Spectral Orb
// My first sphere on a checker floor ever
// ...about time after all these years of poving
//
// Peter Popov
//
// p.s. you need the dispersion patch for 3.1 for this one

#include "kolors.inc" 
// by Ken Tyler, use standard colors if
// this is not available

plane 
{ y, 0 
  texture
  {
    pigment { checker color White color Black } // heh heh
    finish { reflection 0.21 } // looks better, but things get slow
  }  
  scale 10 translate 3*x-2*z
}
sphere
{
  3.5*y, 3
  texture
  {
    pigment { White filter 0.955 }
    finish 
    { 
      diffuse 0.1
      ambient 0.6 
      specular 0.3 
      roughness 0.0015 
      phong 0.1
      phong_size 10
      reflection 0.17 
      irid { 0.175 thickness 0.25 turbulence 0.1}
    }
  }
  interior
  {
    ior 1.475
    caustics 1
    fade_distance 6
    fade_power 2.5
    dispersion 1.1
    disp_nelems 20
  }
}

camera
{
  location <4,8,-12>
  look_at 0
}

#declare num=10;
// number of light sources to use for caustics
// twice as many will be used for the halo around the shadow

#declare i=0;
#while (i<1)
  #switch (i)
    #range (0,2/6)
      #declare correction = <1,6*i/2,0>;
    #break
    #range (2/6,3/6)
      #declare correction = <1-(i-2/6)*6,(i-2/6)*6,0>;
    #break
    #range (4/6,5/6)
      #declare correction = <0,1-(i-4/6)*6,(i-4/6)*6>;
    #break;
    #range (5/6, 1)
      #declare correction = <(i-6/7)*6/2,0,1>;
    #break
  #end
  
  #declare correction = correction*<0.6,0.6,1>*1.25;
  
  light_source 
  { <20,90-i*30,100> color White*correction*0.8/num
    spotlight
    radius 0.1
    falloff 0.3
    point_at 3.5*y
    tightness 100
  }
  light_source 
  { <20,75,100> color White*correction*0.5/num
    spotlight
    radius 1.1
    falloff 1.6
    point_at 3.5*y
    tightness 0
    rotate y*4*i
  }
  light_source 
  { <20,75,100> color White*correction*0.5/num
    spotlight
    radius 1.5
    falloff 1.6
    point_at 3.5*y
    tightness 0
    rotate -y*4*i
  }
  #declare i=i+1/num;
#end
 
light_source 
  { <20,75,100> color White*0.6 // <1, 0.95,0.975>*0.6
    spotlight
    radius 1
    falloff 4
    point_at 3.5*y
    tightness 50
  }


light_source 
{ <40,50,-100> White 
  spotlight
  radius 5
  falloff 10
  point_at 3.5*y
}
 
------------------ code ends


Post a reply to this message

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