POV-Ray : Newsgroups : povray.text.scene-files : Sphere and Superellipsoid world Server Time
31 Oct 2024 12:17:31 EDT (-0400)
  Sphere and Superellipsoid world (Message 1 to 2 of 2)  
From: Paul Vanukoff
Subject: Sphere and Superellipsoid world
Date: 30 Mar 2000 07:41:22
Message: <38e34b72@news.povray.org>
// Persistence of Vision Ray Tracer Scene Description File
// File: .pov
// Vers: 3.1
// Desc: Sphere and Superellipsoid World
// Date: 2000 March 29
// Auth: Paul Vanukoff - van### [at] primenetcom


#global_settings {max_trace_level 15}
#declare sd=seed(802);
#declare map=array[40][40][10]

// fill first layer (layer 0)

#declare i=0;
#while(i<40)
 #declare j=0;
 #while(j<40)

  #switch(rand(sd))
   #range( 0.00, 0.25)
    #declare map[i][j][0] = 0; // 25% holes
   #break
   #range( 0.25, 0.50)
    #declare map[i][j][0] = 1; // 25% spheres
   #break
   #range( 0.50, 1.00)
    #declare map[i][j][0] = 2; // 50% superellipsoids
   #break
  #end

 #declare j=j+1;
 #end
#declare i=i+1;
#end

// fill other layers (layers 1-9)

#declare h=1;
#while(h<10)
 #declare i=0;
 #while(i<40)
  #declare j=0;
  #while(j<40)

   #switch(map[i][j][h-1])
    #case( 0)
     #declare map[i][j][h]=0;
    #break
    #case( 1)
     #declare map[i][j][h]=0;
    #break
    #case( 2)
     #switch(rand(sd))
      #range( 0.00, 0.25)
       #declare map[i][j][h] = 0; // 25% holes
      #break
      #range( 0.25, 0.50)
       #declare map[i][j][h] = 1; // 25% spheres
      #break
      #range( 0.50, 1.00)
       #declare map[i][j][h] = 2; // 50% superellipsoids
      #break
     #end
    #break
   #end

  #declare j=j+1;
  #end
 #declare i=i+1;
 #end
#declare h=h+1;
#end

// render all layers

#declare h=0;
#while(h<10)
 #declare i=0;
 #while(i<40)
  #declare j=0;
  #while(j<40)

   #switch(map[i][j][h])
    #case( 0)

    #break
    #case( 1)
     sphere
     {
      < 0, 0, 0>, 1
      translate < 2*i-40, 2*h, 2*j-40>
      pigment
      {
       color rgb vnormalize(< rand(sd), rand(sd), rand(sd)>)
      }
      finish
      {
       diffuse 7/8
       ambient 0
       phong 1
       reflection 1/4
      }
     }
    #break
    #case( 2)
     superellipsoid
     {
      < 0.15, 0.15>
      translate < 2*i-40, 2*h, 2*j-40>
      pigment
      {
       color rgb vnormalize(< rand(sd), rand(sd), rand(sd)>)
      }
      finish
      {
       diffuse 7/8
       ambient 0
       phong 1
       reflection 1/4
      }
     }
    #break
   #end
  #declare j=j+1;
  #end
 #declare i=i+1;
 #end
#declare h=h+1;
#end

plane
{
 y, -1

 pigment
 {
  color rgb 0
 }
 normal
 {
  granite 0.1
  scale 3
 }
 finish
 {
  diffuse 7/8
  ambient 0
  phong 1
  reflection 1/4
 }
}

sky_sphere
{
 pigment
 {
  bozo turbulence 0.75
  color_map
  {
   [0.0 color rgb < 0.1, 0.1, 0.9>]
   [0.2 color rgb < 0.1, 0.1, 0.9>]
   [1.0 color rgb < 1.0, 1.0, 1.0>]
  }
  scale 1/10
  scale < 3, 1, 3>
 }
}

#declare cam_loc = < 37.0, 20.0,-37.0>;

camera
{
 location cam_loc
 look_at < 18.0, 0.0,-18.0>
}

light_source
{
 2 * < 0.0, cam_loc.y, 0.0>
 color rgb 3/8
}

light_source
{
 2 * cam_loc
 color rgb 5/8
}


Post a reply to this message

From: Steve
Subject: Re: Sphere and Superellipsoid world
Date: 31 Mar 2000 04:39:28
Message: <slrn8e7hug.2vr.sjlen@zero-pps.localdomain>
Thanks Paul.

-- 
Cheers
Steve              email mailto:sjl### [at] ndirectcouk

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.ndirect.co.uk/~sjlen/

or  http://start.at/zero-pps

 10:20pm  up 1 day, 23:09,  6 users,  load average: 1.19, 1.06, 1.01


Post a reply to this message

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