POV-Ray

POV­Ray
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
1
POV­Ray
●
●
●
Developed in the 1980th
First steps by David Kirk Buck, he called it DKBTrace
It was turned to a group of developers in 1991
and called
Persistence of Vision Raytracer
POV-R ay
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
2
examples
by Sibylle Nägle
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
3
examples
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
by Sibylle Nägle
4
some examples
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
by Jaime Vives Piqueres
5
some examples
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
by Jame Vives Piqueres
6
some examples
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
by Gilles Tran
7
some examples
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
by Jaime Vives Piqueres
8
some examples
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
by Jonathan Hunt
9
Raytracing
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
10
mechanisms ­ reflection
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
11
mechanisms ­ absorption
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
12
mechanisms ­ refraction
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
13
mechanisms ­ example
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
14
coordinates
lefthanded coordinate system
08.12.1009
by F.A. Lohmüller
Dipl.­Ing Sibylle Nägle, MPI­DS
15
first scene
necessary ingredients:
light source
camera
object to be shown
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
16
first scene
light_source { <200,300,300> rgb <1,1,1> }
camera { location <10,10,10> look_at <0,0,0> }
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } }
povray +imyscene.pov +omyscene.png +A0.0
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
17
adding background
light_source { <200,300,300> rgb <1,1,1> }
camera { location <10,10,10> look_at <0,0,0> }
background { color rgb <0.5,0.7,0.9> }
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
18
phong
light_source { <200,300,300> rgb <1,1,1> }
camera { location <10,10,10> look_at <0,0,0> }
background { color rgb <0.5,0.7,0.9> }
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } finish { phong 1 } }
phong determines brightness ­­ 0= dull, 1=bright
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
19
mehrere Lichtquellen
light_source { <200,300,300> rgb <1,1,1> }
light_source { <110,120,30> rgb <1,1,1> }
camera { location <10,10,10> look_at <0,0,0> }
background { color rgb <0.5,0.7,0.9> }
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } finish { phong 1 } }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
20
basic objects ­ box
P2
Box:
box { <x1,y1,z1> , <x2,y2,z2> }
P1
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
21
basic objects ­ cylinder
P2
Cylinder:
cylinder { <x1,y1,z1> , <x2,y2,z2>,r }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
r
P1
22
basic objects ­ cone
P2
r2
Cone:
cone { <x1,y1,z1>,r1, <x2,y2,z2>,r2 }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
P1
r1
23
basic objects ­ torus
r2
Torus:
torus { r1, r2 }
08.12.1009
r1
Dipl.­Ing Sibylle Nägle, MPI­DS
24
basic objects ­ plane
Plane:
plane { <0,1,0>,0 }
n
Normal vector and distance to origin
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
P
25
basic objects ­ text
Text:
text { ttf “timrom.ttf” “POV­Ray” 0.15, 0
pigment { rgb <1,0.4,0.9> } finish { phong 1} }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
0,0,0
26
transformation: scale
light_source { <200,300,300> rgb <1,1,1> }
camera { location <10,10,10> look_at <0,0,0> }
background { color rgb <0.5,0.7,0.9> }
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } finish { phong 1 } scale <0,0.3,0> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
27
transformation: translate
light_source { <200,300,300> rgb <1,1,1> }
light_source { <110,120,30> rgb <1,1,1> } camera { location <10,10,10> look_at <0,0,0> }
background { color rgb <0.5,0.7,0.9> }
box { <0,0,0>,<5,5,5> pigment { rgb <1,0.4,0.9> } finish { phong 1 } translate <0,­3,0> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
28
transformation: rotate
light_source { <200,300,300> rgb <1,1,1> }
light_source { <110,120,30> rgb <1,1,1> } camera { location <10,10,10> look_at <0,0,0> }
background { color rgb <0.5,0.7,0.9> }
box { <0,0,0>,<5,5,5> pigment { rgb <1,0.4,0.9> } finish { phong 1 } rotate <30,0,0> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
29
several objects: union
#declare myobject = union {
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } finish { phong 1 } }
box { <­5,­5,­5>,<5,5,5> pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
}
object { myobject }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
30
several objects: difference
#declare myobject = difference {
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } finish { phong 1 } }
box { <­5,­5,­5>,<5,5,5> pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
}
object { myobject }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
31
several objects: intersection
#declare myobject = intersection {
sphere { <0,0,0>,6 pigment { rgb <1,0.4,0.9> } finish { phong 1 } }
box { <­5,­5,­5>,<5,5,5> pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
}
object { myobject }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
32
combining objects
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
33
adding a floor
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
plane { <0,1,0>,­5 pigment { rgb <0.9,0.5,0.7> } }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
34
patterns
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
35
prepared textures ­ cork
#include “textures.inc”
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject texture { Cork scale <10,10,10> } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
36
patterns
#declare myobject = union {
sphere { <0,0,0>,6 }
}
object { myobject pigment { image_map { jpeg "images/earth.jpg" once map_type 1 } rotate <0,180,40> } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
37
transparency
#declare myobject = union {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject pigment { rgbf <0.4,0.9,1,0.5> } finish { phong 1 } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
38
index of refraction
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject pigment { rgbf <0.4,0.9,1,0.8> } finish { phong 1 ior 1.5 } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
39
prepared textures ­ glass
#include “textures.inc”
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject texture { Glass3 } pigment { rgbf <0.4,0.9,1,0.8> } finish { phong 1 ior 1.5 } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
40
prepared textures ­ glass
#include “textures.inc”
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject texture { Glass3 } pigment { rgbf <0.4,0.9,1,0.8> } finish { phong 1 ior 1.5 } }
plane { <0,1,0>,­5 pigment { brick rgb <1,1,1>, rgb <0.9,0.5,0.7> }
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
41
loops
#declare myx=­7;
#declare myobject_diff = difference {
#declare myobject = intersection {
sphere { <0,0,0>,6 }
box { <­5,­5,­5>,<5,5,5> }
}
object { myobject pigment { rgb <0.4,0.9,1>} finish { phong 1 } }
#while (myx<10)
box { <myx­0.01,­6,­6>,<myx+0.5,6,6> }
#declare myx = myx+1;
#end
}
object { myobject_diff pigment { rgb <0.4,0.9,1> } finish { phong 1 } }
plane { <0,1,0>,5 pigment { rgb <0.9,0.5,0.7> } } 08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
42
loops
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
43
references
Documentation: http://www.povray.org/documentation/
Tutorial (in german): http://www.f­lohmueller.de/pov_tut/animate/pov_anid.htm
Pictures:
Raytracing: http://en.wikipedia.org/wiki/Ray_tracing_(graphics)
Refraction, Reflection, ... http://photoprotection.clinuvel.com/photodermatology­photobiology
Coordinate system: http://www.f­lohmueller.de/pov_tut/basic/povkurs2.htm
Earth: http://it­material.de/2009/09/meteosat­2­artificially­coloured­visible­channel­full­disk­earth­image/
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
44
thanks
08.12.1009
Dipl.­Ing Sibylle Nägle, MPI­DS
45