shapes.pov 2.42 KB
#include "colors.inc"
#include "glass.inc"
#include "golds.inc"
#include "metals.inc"
#include "stones.inc"
#include "woods.inc"
#include "textures.inc"
#include "shapes3.inc"

global_settings { assumed_gamma 1.0 }

#declare my_blue   = rgb<0.000, 0.404, 0.698>;
#declare my_lblue  = rgb<0.278, 0.671, 0.871>;
#declare my_green  = rgb<0.278, 0.667, 0.259>;
#declare my_orange = rgb<0.965, 0.518, 0.157>;
#declare my_yellow = rgb<1.000, 0.831, 0.329>;
#declare my_red    = rgb<0.933, 0.220, 0.173>;
#declare my_purple = rgb<0.635, 0.169, 0.675>;

camera {
  // negative for right-handed coordinates
  // 16/9 aspect ratio (to avoid distortions)
  right     <1,   0,   0>

  location  <   0,   2,  -5>
  look_at   <   0,   0,   0>
  sky       <   0,   1,   0>

  angle 45
}

light_source { <100, 100, -100> color White }

background { color White }

#macro SPHERE()
sphere {
	<0,0,0>, 1
	scale 2
	pigment { color my_red }
	finish { phong 0.4 ambient 0.1 diffuse 0.9 }
}
#end

#macro BOX()
box { 
	<-0.5, -0.5, -0.5> 
	< 0.5,  0.5,  0.5>
	rotate < 0, 30, 15>
	translate <0.07, 0.05, 0>
	scale 2.6

	pigment { color my_blue }
	finish { phong 0.8 ambient 0.1 diffuse 0.9 }
}
#end

#macro TUBE()
object {
	difference { 
		cylinder {
			<0, -1, 0> <0, 1, 0>, 1
			pigment { color my_orange }
			finish { phong 1.0 ambient 0.2 specular 0.15 diffuse 0.75 }
		}

		cylinder { <0, -1.1, 0> <0, 1.1, 0>, 0.75 
			pigment { color my_orange }
			finish { phong 1.0 ambient 0.2 specular 0.15 diffuse 0.75 }
		}
	}

	rotate < -60, 25, 15>
	translate <0.13,-0.1,0>
	scale 1.5
}
#end

#macro CONE()
cone { <0,-0.5,0>, 1.4, <0,2,0>, 0.4
	rotate <-20, 0, 30>
	translate <0.13, -0.17, 0>
	scale 1.2
	pigment { color my_purple }
	finish { phong 0.3 ambient 0.1 diffuse 0.9 }
}
#end

#macro TORUS()
torus { 1.0, 0.4
	rotate <-20, 0, 30>
	translate <-0.1, 0.1, 0>
	scale 1.5
	pigment { color my_lblue }
	finish { phong 0.3 ambient 0.1 diffuse 0.9 }
}
#end

#macro TRAPEZOID()
object { // trapezoid
	Pyramid_N_AB(4, <0,-1,0>, 2.0, <0,1,0>, 0.9)
	rotate <0, 30, 0>
	rotate <-10, 0, 0>
	translate <0.2, 0.7, 0>
	scale 0.8
	pigment { color my_green }
	finish { phong 1.0 ambient 0.2 specular 0.15 diffuse 0.75 }
}
#end

#macro POLYHEDRON()
isosurface {
	function { abs(x)+abs(y)+abs(z)-2.9  }
	contained_by { box { -2, 2 } }
	accuracy 0.003
	max_gradient 5
	pigment { color my_yellow }
	finish { phong 1.0 ambient 0.2 specular 0.15 diffuse 0.75 }
	//rotate <-5, -10, 0>
	rotate <10, -10, 90>
	scale 0.92
}
#end