domenica 21 settembre 2014

A simple POV Ray file

This is a simple demonstration of a POV Ray file, written example.

// PoVRay 3.7 Scene File " Prato.pov"
// author:  Max
// date:    13 September 2014
//--------------------------------------------------------------------------
#version 3.7;
global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 }} 
//--------------------------------------------------------------------------
#include "colors.inc"
#include "textures.inc"
//#include "glass.inc"
//#include "metals.inc"
//#include "golds.inc"
//#include "stones.inc"
#include "woods.inc"
#include "shapes.inc"
#include "shapes2.inc"
//#include "functions.inc"
#include "math.inc"
//#include "transforms.inc"
#include "skies.inc"

//--------------------------------------------------------------------------
// camera ------------------------------------------------------------------
#declare Camera_0 = camera {/*ultra_wide_angle*/ angle 75      // front view
                            location  <0.0 , 1.0 ,-3.0>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
#declare Camera_1 = camera {/*ultra_wide_angle*/ angle 90   // diagonal view
                            location  <2.0 , 4.5 ,-3.0>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
#declare Camera_2 = camera {/*ultra_wide_angle*/ angle 90 // right side view
                            location  <3.0 , 1.0 , 0.0>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
#declare Camera_3 = camera {/*ultra_wide_angle*/ angle 90        // top view
                            location  <0.0 , 3.0 ,-0.001>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
camera{Camera_1}
// sun ---------------------------------------------------------------------
light_source{<-1500,2000,-2500> color White}

           

// sky ---------------------------------------------------------------------

sky_sphere{ S_Cloud4  // 1 - 5
            scale 1         
          } //end of skysphere
//--------------------------------------------------------------------------


// fog ---------------------------------------------------------------------
fog{ fog_type   2
     distance   50
     color      White*0.5
     fog_offset 0.1
     fog_alt    2.0
     turbulence 0.8
   } // end of fog
//--------------------------------------------------------------------------




// fog on the ground -------------------------------------------------
fog { fog_type   2
      distance   50
      color      White  
      fog_offset 0.1
      fog_alt    1.5
      turbulence 1.8
    }

// ground ------------------------------------------------------------
plane { <0,1,0>, 0 
        texture{ pigment{ color rgb<0.35,0.65,0.0>*0.72 }
        normal { bumps 0.75 scale 0.015 }
                 finish { phong 0.1 }
               } // end of texture
      } // end of plane
//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
//--------------------------------------------------------------------------

union {
   object{ // Wire_Box(A, B, WireRadius, UseMerge)
        Wire_Box(<-1,-0.15,-1>,<1,2,1>, 0.075   , 0)  
       
          texture{ pigment{ hexagon color White color Blue color Red }   
                finish { diffuse 0.9 phong 1 } 
                rotate<60,0,0> scale 0.05 translate<0,0,0>
              } // end of texture 
               
        scale 1  rotate<0, 0,0> translate<0,0.1,0>
      } // ---------------------------------------------   
      
             


      object{ 
         box {<-0.95,-0.10,-0.95>,<0.95,1.95,0.95>}  
       
                      texture{ T_Wood1     
                normal { wood 0.5 scale 0.05}
                finish { phong 1 } 
                rotate<0,0, 0> scale 0.5
              } // end of texture ------------------------


               
        scale 1  rotate<0, 0,0> translate<0,0.1,0>
      } // ------

    }
The result is the picture showed below.


domenica 14 settembre 2014

A new book

I've started a new book around C++ and the POV Ray program, I'm learning in these days. During the next weeks I'll post my findings and pictures related to ray tracing and application on the C++ language as a tto to extend the functionality of the POV Ray program.

Here it is the first sample picture.