Introduction to the scenery description langage of the POV-Ray Raytracer         - page 3 -
by Friedrich A. Lohmüller
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorials
 
  
POV-Ray Introduction
   Content  -  INDEX
 
  0. Working with POV-Ray:
      "Insert Menu Add-on".
  1. Basics
      on writing texts.
  2. 3D Coordinates,
      Floats and Vectors
>3. Scene Structur
      #include files,
      camera, light_source.
      Types of light sources
  4. Basic Objects plane, sphere,
      box, cylinder, cone, torus.
      Other Shapes
      height_field, text, etc.
  5. Transformations
      Streching, Turning,
      Moving and others.
      CSG: union,
      difference, intersection.
  6. Color + Surfaces       texture, pigment, normal, finish
  7. #declare, #local,
      #macro .. #end,
      #include,
      re-usable objects.
  8. #while Loops
  9. Efficiency,
      speed, flexibility,
      modulare working
      adapting from 3.1 to 3.5;3.6
      adapting from 3.5;3.6 to 3.7
      POV-Ray + Windows Vista.
 
  - Insert Menu Add-on
    & Download
                                       

III  What belongs to a scene?

A description of a scene must include (at least) the following components:

  • 0. #include Including files with predefined declarations for colors, textures, and similar things.
  • 1. camera = defines camera type, standpoint and where we look at.
  • 2. light_source = defines the position and the color of the light.
  • 3. geometric objects and their properties, in details:
  • 3.1 Shape ("plane, sphere, box, cylinder, cone, torus" and a lot of others!)
    This shape may be a basic geometric shape or it may be combined by those shapes with different methods. The way to do this is called CSG = Constructive Solid Geometry.
  • 3.2 Transformations = modifications of position and shape
        3.2.1: Scaling - changes of the scale ("scale ")
        3.2.2: Rotations around the center of the coordinate system ("rotate")
        3.2.3: translations ("translate")
  • 3.3 Texture = description of the consistence of the surface ("texture" )
        3.3.1.: color (must!) and transparency (optional, only if necessary!) ( pigment{....})
        3.3.2.: roughness (optional, if not wanted to be smooth!)       ( normal  {.....})
        3.3.3.: brightness and brilliance of the surface (should be used!) ( finish    {....})



Sample of a Scenery Description File
// PoVRay 3.7 Scene File "Minimal.pov"
// by Friedrich A. Lohmueller, Oct-2009
//-------------------------------------------
#if( version < 3.7 )
     global_settings{assumed_gamma 1.0} #end
#default{ finish{ ambient 0.1 diffuse 0.9 }}
//------------------------------------------
#include "colors.inc"
#include "textures.inc"
//------------------------------------------
// camera ----------------------------------
camera{ location  <0.0 , 1.0 ,-3.0>
        look_at   <0.0 , 1.0 , 0.0>
        right x*image_width/image_height
        angle 75 }
// sun -------------------------------------
light_source{<1500,3000,-2500> color White}
// sky -------------------------------------
plane{ <0,1,0>,1 hollow
       texture{
         pigment{ bozo turbulence 0.92
           color_map{
                 [0.00 rgb<0.05,0.15,0.45>]
                 [0.50 rgb<0.05,0.15,0.45>]
                 [0.70 rgb<1,1,1>        ]
                 [0.85 rgb<0.2,0.2,0.2>  ]
                 [1.00 rgb<0.5,0.5,0.5>  ]
                       } //
           scale<1,1,1.5>*2.5
           translate<0,0,0>
           } // end of pigment
         finish {ambient 1 diffuse 0}
        } // end of texture
       scale 10000}
// fog on the ground -----------------------
fog { fog_type   2
      distance   50
      color      rgb<1,1,1>*0.8
      fog_offset 0.1
      fog_alt    1.5
      turbulence 1.8
    } //
// ground ----------------------------------
plane{ <0,1,0>, 0
       texture{
          pigment{ color rgb<0.22,0.45,0>}
          normal { bumps 0.75 scale 0.015 }
          finish { phong 0.1 }
       } // end of texture
     } // end of plane
//------------------------------------------
//------------------------------------------
// objects in scene ------------------------
sphere{ <0,0,0>, 0.75
        translate<0.85,1.1,0>
        texture{
          pigment{ color rgb<0.9,0.55,0>}
          finish { phong 1 }
        } // end of texture
      } // end of sphere
//------------------------------------- end 
<-comments: version, titel, author, date

<- version selection
<- evtl. with gamma correction

<- default values for indirect/direct illumination


<- including of files with
    predefined colors and textures

<- standpoint
<- where to look at

<- "Let there be light ... "


< Now the objects are following,
of which this world consists:
> the sky...

> the ground ...

> the groundfog ...

> ...and e.g. a hovering sphere
   colored warm yellow





And here it is, how this world looks like:

top

© Friedrich A. Lohmüller, 2009
email email: Friedrich.Lohmueller_at_t-online.de
homepage:http://www.f-lohmueller.de