Introduction to the Scenery Description Langage of the POV-Ray Raytracer        
by Friedrich A. Lohmüller
           Cameras, Light Sources and Details in POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorials
 
  
Camera + Light
  
in POV-Ray
  Content  -  INDEX
 
 Types of Light Sources:
   point light
   spotlight
   cylindrical spotlight,
   parallel light,
   area light, soft shadows
 
 Light Source Specials:
   Visible light sources
   Shadowless light sources
   projected_through
   Fade out
 
 Types of Cameras:
   Perspective camera
   Ultra_wide_angle
   Orthographic camera
   Cylindrical camera
   Spherical camera
   Fisheye camera
   Panoramic camera
   Omnimax camera
 
 Camera Specials:
   Aspect ratio
   Focal blur
   Perturbated camera

 Architectural Perspective
 
 Show and Hide:
   no_shadow
   no_reflection
   no_image
   no_body
 
                                             
Camera Specials:
Aspect ratio
( aspect ratio = image_width / image_height )
The POV-Ray camera with a perspective camera uses the following aspect ratio:

camera{ location <0,1,-3>
        look_at  <0,1,0>
        up       <0,1,0>
        right <1.33,0,0> } 
The vectors up and right are determing an aspect ratio. Here (by default) we have an aspect ratio of 4:3 (= 1.33/1).
default aspect ratio 4:3 with image 4:3
The Aspect ratio Problem:
If we change the image size to a quadatic image or an image in 16:9, we see here:

Why this distortions?


With 1:1 we should use
right <1,0,0>
and with 16:9 we should use
right <16/9,0,0> !!!
Default aspect ratio 4:3
with an image 1:1

Default aspect ratio 4:3
with an image 16:9

Solution of the aspect ratio problem:
There are two preset variables in POV-Ray for the actually
used image dimensions called
image_width and image_height:


camera{ location <0,1,-3>
        look_at  <0,1,0>
        right x*image_width/image_height
        }  // no right vector! 
                  (x = <1,0,0>)
Now with this automatic aspect ratio, we'll get this:

No distortions anymore!
Automatic aspect ratio
with an image 1:1

Automatic aspect ratio
with an image 16:9


Focal blur
Simulating the 'depth of field' of a real photographic camera.
camera{ angle 40
        location < 0.00,2.00,-3.00>
        look_at  < 0.00,2.00, 1.00>
        right  x*image_width/image_height      
     // focal blur settings:
        focal_point <0.20,1.5,-5.25>
        aperture 0.7     // 0.05 ~ 1.5
        blur_samples 100 // 4 ~ 100
        confidence 0.9   // 0 ~ 1
        variance 1/128   // 1/64 ~ 1/1024 ~
      } 
focal_point <0.20,1.5,-5.25> // This point is in focus 'sharp'
(I used a little red sphere to find the correct point!)
aperture 0.7 // 0.05 ~ 1.5; // more = more blurring
blur_samples 100 // 4 ~ 100, more = higher quality; fewer = faster
confidence 0.9 // how close to the correct color, 0 ~ 1, default 0.9
variance 1/128 //(default) smallest displayable color difference
focal blur off
focal blur on

Perturbated camera
Using normal statement for camera.
camera{ angle 40
        location < 0.00,2.00,-3.00>
        look_at  < 0.00,2.00, 1.00>
        right  x*image_width/image_height      
        normal{ bumps 0.15
                scale 0.4 translate<-0.2,0,0>}
      } 
....



camera{ angle 40
        location < 0.00,2.00,-3.00>
        look_at  < 0.00,2.00, 1.00>
        right  x*image_width/image_height      
        normal{ cells 0.15 turbulence 0.2
                scale 0.3 translate<-0.0,0,0>}
      } 
perturbated by normal bumps
perturbated by normal cells

Index | Lights | Light Specials | Cameras | Camera Specials | Architectural Perspective | Show+Hide

top

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