File: trace2.pov

package info (click to toggle)
povray 1%3A3.8.0~beta.2-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 160,364 kB
  • sloc: cpp: 861,153; ansic: 125,127; sh: 34,680; pascal: 6,892; asm: 3,355; ada: 1,681; makefile: 1,432; cs: 879; perl: 645; awk: 590; python: 394; xml: 95; php: 13; javascript: 6
file content (92 lines) | stat: -rw-r--r-- 1,957 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// This work is licensed under the Creative Commons Attribution 3.0 Unported License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
// or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View,
// California, 94041, USA.

// Persistence of Vision Raytracer Scene Description File
// File: trace2.pov
// Last updated: 8/25/01
// Author: Chris Huff
// Description: pins on a height field...animated.
//
// -w320 -h240
// -w800 -h600 +a0.3
//
//*******************************************

#version 3.6;

#declare GridXRes = 16;
#declare GridZRes = 16;
// Total # of pins will be GridXRes*GridZRes...be careful
//not to use too high of a number.
#declare PinHeight = 0.25;

#include "functions.inc"
#include "math.inc"
#include "consts.inc"
#include "colors.inc"

//-------------------------------------------

global_settings {
  assumed_gamma 1.0
}

#default {finish {ambient 0 diffuse 1}}

#declare CamLoc = < 3, 4,-5>;

camera {
	location CamLoc
        right     x*image_width/image_height
	look_at < 0, 0, 0>
	angle 24
}

light_source {CamLoc color White*0.35}
light_source {<-50, 150,-75> color White}
//-------------------------------------------

#declare Land =
isosurface {
	function {y + f_noise3d(x, y+clock*2, z)}
	threshold 0
	max_gradient 1.75
	contained_by {box {<-1.1,-1,-1.1>, < 1.1, 1, 1.1>}}
	translate y*0.75
}

union {
	#declare J = 0;
	#while(J < GridXRes)
		#declare K = 0;
		#while(K < GridZRes)
			#declare stPt = <2*J/(GridXRes-1) - 1, 10, 2*K/(GridZRes-1) - 1>;
			#declare iNorm = y;
			#declare iPt = trace(Land, stPt, -y, iNorm);
			#if(!VZero(iNorm))
				cylinder {iPt, iPt + iNorm*PinHeight, 0.01}
			#end
			#declare K = K + 1;
		#end
		#declare J = J + 1;
	#end
	texture {
		pigment {color Green}
		finish {
			specular 1
		}
	}
}

object {Land
	texture {
		pigment {color White}
		finish {
			specular 1
		}
	}
}
//*******************************************