Upload
nguyenxuyen
View
216
Download
0
Embed Size (px)
Citation preview
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 2
POVRay
● 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 calledPersistence of Vision Raytracer
POV-Ray
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 15
coordinates
lefthanded coordinate systemby F.A. Lohmüller
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 16
first scene
necessary ingredients: light source camera object to be shown
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 17
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, MPIDS 18
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, MPIDS 19
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, MPIDS 20
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, MPIDS 21
basic objects box
Box:box { <x1,y1,z1> , <x2,y2,z2> }
P1
P2
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 22
basic objects cylinder
Cylinder:cylinder { <x1,y1,z1> , <x2,y2,z2>,r }
P1
P2
r
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 23
basic objects cone
Cone:cone { <x1,y1,z1>,r1, <x2,y2,z2>,r2 } P1
r1
P2
r2
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 25
basic objects plane
Plane:plane { <0,1,0>,0 }
Normal vector and distance to origin P
n
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 26
basic objects text
Text:text { ttf “timrom.ttf” “POVRay” 0.15, 0
pigment { rgb <1,0.4,0.9> } finish { phong 1} }
0,0,0
08.12.1009 Dipl.Ing Sibylle Nägle, MPIDS 27
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, MPIDS 28
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, MPIDS 29
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, MPIDS 30
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, MPIDS 31
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, MPIDS 32
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, MPIDS 33
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, MPIDS 34
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, MPIDS 35
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, MPIDS 36
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, MPIDS 37
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, MPIDS 38
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, MPIDS 39
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, MPIDS 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, MPIDS 41
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, MPIDS 42
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 { <myx0.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, MPIDS 44
references
Documentation: http://www.povray.org/documentation/ Tutorial (in german):
http://www.flohmueller.de/pov_tut/animate/pov_anid.htm
Pictures: Raytracing:
http://en.wikipedia.org/wiki/Ray_tracing_(graphics) Refraction, Reflection, ...
http://photoprotection.clinuvel.com/photodermatologyphotobiology Coordinate system:
http://www.flohmueller.de/pov_tut/basic/povkurs2.htm Earth:
http://itmaterial.de/2009/09/meteosat2artificiallycolouredvisiblechannelfulldiskearthimage/