Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Stereo Images and Stereo Animations with POV-Ray
Deutsch Deutsch
Italiano Italiano
Français français

Home
- POV-Ray Tutorial

  Stereo Images and
  Stereo Animations
    Index

    Cross-Eye View
    Stereo Image simple
    Stereo Image advanced
    Combining Image Pairs
    Stereo Animations 1
 > Stereo Animations 2
    Examples Stereo Ani
 
                                                 
Stereo Animations (2)

Combining Image Pairs for Animations.
2.1: Combining a Serie of Stereo Image Pairs,
         from the previous part Stereo Amimation 1.
The following combining scene file and the according ini file
should be placed in the image file directory!

The combining scene file Stereo_Ani_00_Combi_.pov :
camera{ orthographic
        location < 0.00, 0.50,-8.18 >
        right    x*image_width/image_height
        look_at  < 0.00, 0.50, 0.00 >
        angle    14
      } //------------------------------------
#declare I_Number_r = 2*frame_number-1;
#declare I_Number_l = 2*frame_number;
// left box with image_map texture -----------
box{ <0, -0.5,0>,<0, 0.5, 0.01>
     texture{
       pigment{
         image_map{
         jpeg concat("Stereo_Ani_00_",
                      str(I_Number_r,-2,0),
                      ".jpg")
         map_type 0 interpolate 2 once
         } // end of image_map
       } //  end of pigment
       finish{ ambient 1 }
       translate<0,-0.5,0>
     } // end of texture
     translate< -1,0,0>
     scale<1,image_height/(image_width/2),1>
} // end of left box //-----------------------
// right box with image_map texture ----------
box{ <0, -0.5,0>,<0, 0.5, 0.01>
     texture{
       pigment{
         image_map{
         jpeg  concat("Stereo_Ani_00_",
                      str(I_Number_l,-2,0),
                      ".jpg")
         map_type 0 interpolate 2 once
         } // end of image_map
       } //  end of pigment
       finish{ ambient 1 }
       translate<0,-0.5,0>
     } // end of texture
     scale<1,image_height/(image_width/2),1>
} // end of right box //----------------------
With POV-Ray 3.6 we need an additional gamma correction of the input files
and also the file_type 'sys' instead of 'jpeg' for .bmp images.
- For details see the according scene file!

If the image files have the size 240x240 pixels
  we use in the command line:
" +w480 +h240 ".
With POV-Ray 3.7 we can use the jpeg output by
" +w480 +h240 +fj100 ".
      The attached example file works also with e.g. an
image size of 200x300 pixels, then we use " +w400 +h300 ".
      If we work with a number of stereo images >= 100, we must
change str(I_Number_l,-2,0) to str(I_Number_l,-3,0).
command line
The comandline for Stereo_Ani_00_Combi_.pov/.ini

Cross-Eye View
right eye views:         left eye views:
Stereo_Ani_00_01.jpg
Stereo_Ani_00_02.jpg
Stereo_Ani_00_03.jpg
Stereo_Ani_00_04.jpg
Stereo_Ani_00_05.jpg
Stereo_Ani_00_06.jpg
...
Combinded stereo image pairs:
Stereo_Ani_00_Combi_01.jpg
Stereo_Ani_00_Combi_02.jpg
Stereo_Ani_00_Combi_03.jpg
...
2.2: We start with combining the whole serie of stereo
image pairs by an animation ini file
Stereo_Ani_00_Combi_.ini:
Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Input_File_Name=Stereo_Ani_00_Combi_.pov
Initial_Frame=1
Final_Frame=30
; for 60 stereo image pairs
Initial_Clock=0
Final_Clock=1
Cyclic_Animation=on
Pause_when_Done=off
Running this file combines a serie of 30 stereo image pairs:
from 30 right eye views: numbered 01,03,05,...,29
 and 30 left eye views: numbered 02,04,06,...,30,
combined to Stereo_Ani_00_Combi_01.jpg, to ..._30.jpg.

We can use a fast graphic viewer with a slice show function
to see our animations - POV-Ray does has have a buildt-in
video-maker program!
If we want to save our animations as animated gif, we need
to use other programs like a gif animator.
POV-Ray 3.7
combining scene file: Stereo_Ani_00_Combi_.pov
combining ini file: Stereo_Ani_00_Combi_.ini
POV-Ray 3.6
combining scene file: Stereo_Ani_00_Combi_36_.pov
combining ini file: Stereo_Ani_00_Combi_36_.ini
The according combining scene file and ini file
should be placed in the image file directory
of the single images
,
otherwise we must add the full image paths
in the file Stereo_Ani_00_Combi_.pov .



These cominated files we can put
in an gif animator program:
Stereo animated gif.
top

© Friedrich A. Lohmüller, 2013
www.f-lohmueller.de