-
Notifications
You must be signed in to change notification settings - Fork 1
/
basics.inc
132 lines (112 loc) · 3.1 KB
/
basics.inc
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// ==== Standard POV-Ray Includes ====
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
#include "functions.inc" // internal functions usable in user defined functions
// perspective (default) camera
#macro vue_courante()
//===================
camera {
// orthographic
perspective
location <10.0, 5.0, 10.0>/4
look_at <0.0, 0.0, 0.0>
right x*image_width/image_height
}
#end
#macro vue_dessus(Distance)
//===================
camera {
orthographic
location <0.0,Distance , 0.0>
look_at <0.0, 0.0, 0.0>
}
#end
#macro vue_face(Distance)
//===================
camera {
orthographic
location <Distance, 0.0, 0.0>
look_at <0.0, 0.0, 0.0>
}
#end
#macro vue_cote(Distance)
//===================
camera {
orthographic
location <0,0,Distance>
look_at <0.0, 0.0, 0.0>
}
#end
#macro vue_dessus(Hauteur)
//===================
camera {
orthographic
location <0.0, Hauteur, 0.0>/4
look_at <0.0, 0.0, 0.0>
}
#end
// ==========================================================================
#macro AXES_XYZ(Laxe,Raxe)
//===========================================
// Les 3axes
// Laxes = longueur des axes
// Raxes = Rayon des axes
//
#if ( Laxe <= 0 )
#declare Laxe=5;
#end
#if ( Raxe <= 0 )
// #declare Raxe=0.1;
#declare Raxe=Laxe/50;
#end
//
#declare AxeX= union {
cylinder { <0,0,0> <Laxe,0,0> Raxe }
cone { <Laxe,0,0> 2*Raxe <Laxe+4*Raxe,0,0> 0 }
}
#declare AxeY= union {
cylinder { <0,0,0> <0,Laxe,0> Raxe }
cone { <0,Laxe,0> 2*Raxe <0,Laxe+4*Raxe,0> 0 }
}
#declare AxeZ= union {
cylinder { <0,0,0> <0,0,Laxe> Raxe }
cone { <0,0,Laxe> 2*Raxe <0,0,Laxe+4*Raxe> 0 }
}
//
object { AxeX pigment { color red 1} }
object { AxeY pigment { color green 1} }
object { AxeZ pigment { color blue 1} }
#end
//==============================================
#macro DAMIER()
// ==========================
// An infinite planar surface
// plane {<A, B, C>, D } where: A*x + B*y + C*z = D
plane {
y, // <X Y Z> unit surface normal, vector points "away from surface"
0.0 // distance from the origin in the direction of the surface normal
hollow on // has an inside pigment?
pigment {
// solid pattern for use in texture/pigment/normal(/density)
// cube checker pattern, alternates color1 and color2
checker
color rgbt <1, 1, 1,0.5>,
color rgbt <0, 1, 0,0.5>
}
} // plane
#end
#macro BASIC_LIGHTS()
// ====================================
// An area light (creates soft shadows)
// WARNING: This special light can significantly slow down rendering times!
light_source {
0*x // light's position (translated below)
color rgb 1.0 // light's color
translate <0,5,5> // <x y z> position of light
}
light_source {
0*x // light's position (translated below)
color rgb 1.0 // light's color
translate <2,0.15,0> // <x y z> position of light
}
#end