Source
Source under LGPL below
// Povray source for a wikipedia image of a polycube
// By Andrew Kepert, October 2005
// License : LGPL
#include "colors.inc"
#declare eps=0.001;
background{White}
#declare ringn=31;
#declare ang=0;
#while (ang < 359)
light_source {<0,0,9000> rgb .7/ringn rotate 40*x rotate ang*z}
#declare ang=ang+360/ringn;
#end
light_source {
<0,0,1000> .8*White
area_light <100, 0, 0>, <100, 0, 5>, 7,7
// adaptive 1
rotate 55*x rotate 15*z
}
#declare r=0.05;
#declare ptA=<r,r,r>;
#declare ptB=<1-r,r,r>;
#declare ptC=<1-r,r,1-r>;
#declare ptD=<r,r,1-r>;
#declare cubiecentre=<0.5,0.5,0.5>;
#declare cubiefrag=union{
cylinder { ptA,ptB,r }
sphere { ptB,r }
cylinder { ptB,ptC,r }
sphere { ptC,r }
cylinder { ptC,ptD,r }
}
#declare cubie=union{
box { <r,r,0>,<1-r,1-r,1> }
box { <r,r,0>,<1-r,1-r,1> translate -cubiecentre rotate 90*x translate cubiecentre}
box { <r,r,0>,<1-r,1-r,1> translate -cubiecentre rotate 90*y translate cubiecentre}
#if(1)
object { cubiefrag }
object { cubiefrag translate -cubiecentre rotate 90*z translate cubiecentre }
object { cubiefrag translate -cubiecentre rotate 180*z translate cubiecentre }
object { cubiefrag translate -cubiecentre rotate 270*z translate cubiecentre }
#end
}
//=================== floor
#if (1)
plane {
z, -0.1
pigment {checker .95*White, 1*White scale 2.5}
finish {
ambient .2
diffuse .8
}
}
#end
union {
object { cubie translate <0,0,0> }
object { cubie translate <1,0,0> }
object { cubie translate <0,1,0> }
object { cubie translate <0,0,1> }
object { cubie translate <0,-1,1> }
pigment { rgb <.5,.8,1> }
finish { phong 0.8 diffuse 0.6 ambient 0.2 }
}
#if (0) // axes for draft
#declare axislength=7;
cylinder { <0,0,0>,<axislength,0,0>,0.1 texture { pigment { colour rgb <1,0,0> } finish { ambient 1 } } }
cylinder { <0,0,0>,<0,axislength,0>,0.1 texture { pigment { colour rgb <0,1,0> } finish { ambient 1 } } }
cylinder { <0,0,0>,<0,0,axislength>,0.1 texture { pigment { colour rgb <0,0,1> } finish { ambient 1 } } }
#end
//======================== camera stuff
#declare camera_elevation=25;
#declare camera_bearing=-35;
#declare camera_dist=6;
#declare camera_ratio=1/2;
camera {
perspective
direction -x
right y*camera_ratio
up z*camera_ratio
location camera_dist*x
rotate -camera_elevation*y
rotate camera_bearing*z
translate <1,0,1>
}
中文(中国大陆) 添加一行文字以描述该文件所表现的内容