| |
|
 |
Free Multiplatform raytracing with POV-Ray
|
A closer look
|
|
A plane, a cylinder and a lens
|
In the third and final scene we add a glass lens.
#include "colors.inc"
#include "stones1.inc"
#include "glass.inc"
// Monitor brightness
global_settings { assumed_gamma 2.2 }
// Background color
background { color LightBlue }
// The camera
camera {
location <6, 3, -4>
look_at <2.5, 2, 0>
}
// Two lights
light_source { <8, 7, 0> color White }
light_source { <2, 3, -20> color White }
// An infinite checkered plane
plane {
<0, 1, 0>,
0
pigment {
checker color Yellow, color Green
}
finish {
ambient 0.3
diffuse 0.6
}
}
// A stone cylinder
cylinder {
<-4, 2, 3>,
<4, 2, 3>,
2
texture { T_Stone23 scale 4 }
finish {
ambient 0.3
diffuse 0.6
}
}
// An intersection between two speres makes a lens
intersection {
sphere {
<2, 3, -1>
2
}
sphere {
<2, 3, 2>
2
}
material {
texture { T_Glass3 }
interior { I_Glass }
}
}
|
The lens is made using Constructive Solid Geometry (CSG). CSG is a way to build complex shapes by connecting several primitive shapes. In this case, we have built a lens by making two spheres, positioned so that they overlap slightly. The intersection keyword means that we want the shape of the space that are occupied by both spheres, in other words, a lens. Other ways of doing CSG are union, difference and merge.
The glass nature of the lens is achieved by the use of material. The texture describes the surface, and interior describes what's inside. The glass requires a third include, glass.inc.
You should try rendering this scene at a higher resolution, to better see the effects of the glass lens. Then you'll notice that it both magnifies the stone pattern, and reflects light comming from the sides.
Comment List
| Topic: |
Author: |
Time: |
|
Intro to POV
|
Dr M
|
15.05.2005 06:19
|
|
So many website talk about POV;
but this is the first time,
I learnt how to use POV
and that too in 15 minutes.
Keep up the good work.
I am in Silly-Con valley, where clear
explanations are hard to find.
|
|
Great Article!
|
John Holden
|
17.02.2002 16:03
|
|
This has been a really informative article. Although it isn't in-depth, it's perfect for a beginner like me.
Thanks for putting it up here!
John
|
|
sp. origin
|
Vik Olliver
|
24.11.2001 04:48
|
|
Are we meant to proofread here?
It's origin, not origo.
Vik :v)
|
|
RE: sp. origin
|
Gunnstein Lye
|
26.11.2001 13:16
|
|
> Are we meant to proofread here?
> It's origin, not origo.
I'm not a native english speaker, but my dictionary states that the word "origo" can be used when speaking of coordinate systems. But I'll change it if "origin" is more commonly used or more correct.
Gunnstein
|
|
 |
|
|