POV-Ray : Newsgroups : povray.binaries.images : Block coded in PovRay : Block coded in PovRay Server Time
2 Aug 2024 00:14:44 EDT (-0400)
  Block coded in PovRay  
From: H  Karsten
Date: 4 Feb 2008 13:25:01
Message: <web.47a75855985ffec620776f0@news.povray.org>
A view people ask me how I did this:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.4798a383d450dfce811410630%40news.povray.org%3E/?mtop=259872


Well now I tried to code such a cube in PovRay.

Here it is:

//Take a coffee now!!

global_settings {assumed_gamma 3 radiosity {pretrace_start 1 pretrace_end
0.0000001 count 50 error_bound 0.05 recursion_limit 10 brightness 0.5}}

camera {
  ultra_wide_angle
  location  <0.0, 0.1, -1.0>*1.5
  direction 1.5*z
  right     x*image_width/image_height
  angle 90
  look_at   <0.0, 0.65,  0.0>
}

light_source {<-30, 30, -30> color rgb 1}

#declare resolution=60;
#declare densiti=0.125;
#declare chaos=2;

#declare bloks=union{
#declare zet=0;
#while (zet<resolution)

#declare hf=object{height_field {
    function resolution,resolution {
      pigment {
        agate
        color_map {
         [0  color rgb 0]
         [1  color rgb 1]
        }
        turbulence chaos
        scale 1
        translate <0,0,1/resolution*zet>
      }
    }
scale resolution
  } }


#declare zet=zet+1;
#declare iks=0;
#while (iks<resolution)
#declare iks=iks+1;
#declare ueps=0;
#while (ueps<resolution)
#declare ueps=ueps+1;
#if (inside(hf,<iks,(resolution/(1/(1-(densiti)))),ueps>))
box{-0.4,0.4 translate<iks,zet,ueps>}
#end
#end
#end
#end
}
object{bloks
pigment{color rgb 1}
finish{ambient 0 diffuse 1}
scale 1/resolution
translate <-0.5,0,-0.5>
rotate <0,60,0>
}


sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.5 rgb <0.0,0.1,0.8>]
      [1 rgb 0]
    }
  }
}


plane {
  y, 0
  pigment { color rgb 1 }
  finish{ambient 0 diffuse 1}
}


Post a reply to this message


Attachments:
Download 'block.jpg' (259 KB)

Preview of image 'block.jpg'
block.jpg


 

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