All pastes #730150 Raw Edit

Jemand

public text v1 · immutable
·published 2007-10-08 23:13 UTC
rendered paste body
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "metals.inc"
#include "glass.inc"
#include "woods.inc"
#include "functions.inc"

global_settings {max_trace_level 15}


// Uncomment the area lights only if you've got lots of time.
#declare Dist=80.0;
light_source {< -50, 25, -50> color White
     fade_distance Dist fade_power 2
//   area_light <-40, 0, -40>, <40, 0, 40>, 3, 3
//   adaptive 1
//   jitter
}
light_source {< 50, 10,  -4> color Gray30
     fade_distance Dist fade_power 2
//   area_light <-20, 0, -20>, <20, 0, 20>, 3, 3
//   adaptive 1
//   jitter
}
light_source {< 0, 100,  0> color Gray30
     fade_distance Dist fade_power 2
//   area_light <-30, 0, -30>, <30, 0, 30>, 3, 3
//   adaptive 1
//   jitter
}

sky_sphere {
	pigment {
		gradient y
		color_map {
			[0, 1 color Gray50 color Gray80]
		}
	}
}

////////////////////
//		Cameras		//
////////////////////

camera {location <-15, 50, -45> direction <0, 0,  2.25> right x*1.33 look_at 8*y}


//camera {location 15*y look_at 0}

//camera {location -15*z look_at 0}
//camera {location -50*z look_at 0}
//camera {location <0,15,-50> look_at 15*y}
//camera {location <0,15,-15> look_at 15*y}

//camera {location -15*x look_at 0}
//camera {location <15,15,0> look_at 15*y}

//camera {location <-10,10,-10> look_at 0}
//camera {location <-10,-10,-10> look_at 0}
//camera {location <-5,5,-5> look_at 0}
//camera {location <-5,-5,-5> look_at 0}
//camera {location <-2,-2,-2> look_at 0}
//camera {location <-2,2,-2> look_at 0}


////////////////////
//		Macros		//
////////////////////

// Gets angle in radiant, returns position on circle with radius 1
#macro Circle(phi) <cos(phi), sin(phi), 0>
#end


///////////////////////////////////
//		Figure parts - sngeovik		//
///////////////////////////////////

// Piece of coal for the mouth
#declare mouthcoal = superellipsoid {<1.25,1.25> rotate 45*z pigment {color rgb 0.2} scale 0.2}

// Mouth, consisting of the pieces of coal
#declare mouth = union {
	#declare counter = 7;
	#while (counter < 12)
		object {mouthcoal rotate z*counter*30 translate Circle(pi*(counter/6))}
		#declare counter = counter + 1;
	#end
}

// The nose carrot
#declare nose = cone {0, 0.3, z*-2.5, 0 pigment {color Orange}}

// The eyeball
#declare eyeball = sphere {0 0.5 pigment {color Green}}

// The pupil of the eye
#declare pupil = sphere {0 0.2 pigment {color Black}}

// The eye, consistin of the eyeball and the pupil
#declare eye = union {
	object{eyeball scale <1,1,0.7> rotate x*40}
	object{pupil translate <0, 0.04, -0.3>}
}

// The snowball for the body and the head
#declare snowball = sphere {0 1 pigment {color White}}

// The head: a snowball, the mouth, the nose and one eye (cyclop!)
#declare head = union {
	object {snowball scale 2.5}
	object {mouth translate -2.3*z}
	object {nose translate -2.5*z}
	object {eye translate <0,1,-2.1>}
}

// The body: two snowballs
#declare body = union {
	object {snowball scale 5 translate 5*y}
	object {snowball scale 3.5 translate 11.5*y}
}

//////////////////////////////////////
//		Figure parts - accessoires		//    
//////////////////////////////////////
                             
// The shape of the bucket
#declare bucketShape = cone {0 1.5 3*y 1}

// The bucket body, using the shape and cutting out the center
#declare bucketBody = difference {
	object {bucketShape}
	object {bucketShape scale 0.98 translate -0.03*y}
	cylinder {<-1.55, 0.15, -0.05> <-1.35, 0, -0.03> 0.03}
	cylinder {<1.55, 0.15, -0.05> <1.35, 0, -0.03> 0.03}
}

// The ring on the bottom of the bucket
#declare bucketFoot = difference {
	cylinder {0 y*0.15 1}
	cylinder {-0.01*y y*0.16 0.97}
}

// The handle of the bucket
#declare bucketHandle = union {
	difference {
		torus {1.6 0.03 scale <1, 1, 1.6>}
		box {<-3, -0.1, 0> <3, 0.1, 3>}
	}
	cylinder {<-1.6, 0, -0.03> <-1.35, 0, -0.03> 0.03}
	cylinder {<1.6, 0, -0.03> <1.35, 0, -0.03> 0.03}
	pigment {color Grey}
}

// The bucket: body, ring, foot and handle
#declare bucket = union {
	object {bucketBody}
	object {torus {1.51 0.07}}
	object {bucketFoot translate y*3}
	object {bucketHandle rotate x*-20 translate <0, 0.1, 0.05>}
	pigment {color Grey}
}


// The snowman: body and head with bucket
#declare snegovik = union {
	object {body}
	object {head translate 17*y}
	object {bucket rotate <-10,0,-20> scale 1.2 translate <0.6,18.6,-0.4>}
}

//object {mouthcoal}
//object {mouth}
//object {nose}
//object {eyeball}
//object {pupil}
//object {eye}
//object {snowball}
//object {head}
//object {body}

//object {bucketShape}
//object {bucketBody}
//object {bucketFoot}
//object {bucketHandle}
//object {bucket}

object {snegovik}