aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/95-homologie/images/tetraeder.pov
blob: b110f96e116aa24d72fd5a3a92620f2d2d3eb2ed (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// tetraeder.pov
//
// (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
//
#version 3.7;
#include "colors.inc"

global_settings {
	assumed_gamma 1
}

#declare imagescale = 0.169;
#declare O = <0, 0, 0>;
#declare at = 0.02;

camera {
	location <-2, 3, -10>
	look_at <0, 0.18, 0>
	right 16/9 * x * imagescale
	up y * imagescale
}

//light_source {
//      <-14, 20, -50> color White
//      area_light <1,0,0> <0,0,1>, 10, 10
//      adaptive 1
//      jitter
//}

light_source {
	<-41, 20, -20> color White
	area_light <1,0,0> <0,0,1>, 10, 10
	adaptive 1
	jitter
}

sky_sphere {
	pigment {
		color rgb<1,1,1>
	}
}

#declare v1 = <1,1,1>;
#declare v2 = <-1,1,-1>;
#declare farbe = rgbf<0.8,0.8,1.0,0.5>;

#declare tetraederwinkel = acos(vdot(v1,v2)/(vlength(v1)*vlength(v2)));

#declare O = < 0, 0, 0 >;
#declare A = < 0, 1, 0 >;
#declare B = < sin(tetraederwinkel), cos(tetraederwinkel), 0>;
#declare C = < sin(tetraederwinkel)*cos(2*pi/3), cos(tetraederwinkel),  sin(2*pi/3)>;
#declare D = < sin(tetraederwinkel)*cos(2*pi/3), cos(tetraederwinkel), -sin(2*pi/3)>;

#macro arrow(from, to, arrowthickness, c)
#declare arrowdirection = vnormalize(to - from);
#declare arrowlength = vlength(to - from);
union {
	sphere {
		from, 1.0 * arrowthickness
	}
	cylinder {
		from,
		from + (arrowlength - 8 * arrowthickness) * arrowdirection,
		arrowthickness
	}
	cone {
		from + (arrowlength - 8 * arrowthickness) * arrowdirection,
		2 * arrowthickness,
		to - 3 * arrowthickness * arrowdirection,
		0
	}
	pigment {
		color c
	}
	finish {
		specular 0.9
		metallic
	}
}
#end

union {
	arrow(B, C, at, White)
	arrow(D, C, at, White)
	arrow(D, B, at, White)
	arrow(B, A, at, White)
	arrow(C, A, at, White)
	arrow(D, A, at, White)
	sphere { A, 4 * at }
	sphere { B, 4 * at }
	sphere { C, 4 * at }
	sphere { D, 4 * at }
	pigment {
		color White
	}
	finish {
		specular 0.9
		metallic
	}
}

mesh {
	triangle { A, B, C }
	triangle { A, C, D }
	triangle { A, D, B }
	triangle { B, C, D }
	pigment {
		color farbe
	}
//	finish {
//		specular 0.9
//		metallic
//	}
}