In this post, we will show how to generate a water pool using POV Ray, and how to create a relistic wave effect on the pool water using the Isosurface command line.
Here is the code for POV Ray file:
// POV-Ray 3.7 Scene File "Prova7.pov" basato su woodbox
// author: Max
// Date: 14/03/2015
//--------------------------------------------------------------------------
#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"
//--------------------------------------------------------------------------
// camera ------------------------------------------------------------------
#declare Camera_0 = camera {/*ultra_wide_angle*/ angle 75 // vista frontale
location <0.0 , 2.0 ,-8.0>
right x*image_width/image_height
look_at <0.0 , -1.0, 0.0>}
#declare Camera_1 = camera {/*ultra_wide_angle*/ angle 70 // vista diagonale
location <4.0 , 7.5 ,-5.0>
right x*image_width/image_height
look_at <1.0 , 0.0 , -2.5>}
#declare Camera_2 = camera {/*ultra_wide_angle*/ angle 90 // vista lato destro
location <4.0 , 1.0 , 0.0>
right x*image_width/image_height
look_at <0.0 , 0.0 , 0.0>}
#declare Camera_3 = camera {/*ultra_wide_angle*/ angle 40 // vista dall'alto
location <0.0 , 20.0 ,-2.00-0.001>
right x*image_width/image_height
look_at <0.0 , 1.0 , -2.00>}
camera{ Camera_0 }
// sole ---------------------------------------------------------------------
light_source{<-3500,2000,-1500> color rgb<1,0.85,0.85> }
// cielo ---------------------------------------------------------------------
plane{<0,2,0>,2 hollow
texture{ pigment{ bozo turbulence 0.95
color_map { [0.00 rgb <0.25, 0.32, 1.0>*0.8]
[0.50 rgb <0.25, 0.32, 1.0>*0.8]
[0.70 rgb <1,1,1>]
[0.85 rgb <0.25,0.25,0.25>]
[1.0 rgb <0.5,0.5,0.5>]}
scale<1,1,1.5>*2.5 translate<-2,0,0>
}
finish {ambient 1 diffuse 0} }
scale 10000}
// nebbia sul terreno -------------------------------------------------
fog { fog_type 2
distance 75
color White
fog_offset 0.1
fog_alt 2.5
turbulence 1.8
}
//---------------------------------------------
//----------------------------- Piscina trama
#declare Piscina_Tex =
texture{ T_Wood4
finish { specular 0.25 roughness 0.115 ambient 0.2 }
} // fine della trama
//---------------------------------------------
//----------------------------- Piscina dimensioni
#declare Piscina_X = 5.00;
#declare Piscina_Y = 2.00;
#declare Piscina_Z = 8.00;
#declare Piscina_Interno_Size = <5,-2,8>;
#declare Bordo = 0.30;
//---------------------------------------------
#declare Piscina_Transformation =
transform{ rotate<0,0,0>
translate<-2.5,0.10,-6>
} // fine della trasformazione
//---------------------------------------------
#declare Piscina_Interno =
box{<0,-Piscina_Y,0>,<Piscina_X,Piscina_Y,Piscina_Z>
} //--------------------------------------
#declare Piscina_Esterno =
box{<-Bordo, -Piscina_Y-0.01, -Bordo> ,
<Piscina_X+Bordo,0.001,Piscina_Z+Bordo>
} //--------------------------------------
//---------------------------------------------
#declare Piscina =
difference{
object{ Piscina_Esterno texture{Piscina_Tex}}
object{ Piscina_Interno texture{Piscina_Tex}}
} // fine della differenza
//---------------------------------------------
// terreno erboso
difference{
plane{ <0,1,0>, 0
texture{
pigment{ color rgb<0.35,0.65,0>*0.7}
normal { bumps 0.75 scale 0.015 }
finish { phong 0.1 }
} // fine della trama
}// fine del piano
object{ Piscina_Esterno
texture{ Piscina_Tex }
transform Piscina_Transformation
} // buco della piscina
} // fine del terreno
//---------------------------------------
//---------------------------------------
// Mettere la piscina:
object{ Piscina
transform Piscina_Transformation }
//---------------------------------------
//---------------------------------------
// acqua trasparente //-------------
#declare Acqua_materiale =
material{
texture{
pigment{ rgbf <0.92,0.99,0.96,0.45> }
finish { diffuse 0.1 reflection 0.3
specular 0.8 roughness 0.0003
phong 1 phong_size 400}
} // fine della trama --------------------
interior{ ior 1.3 caustics 0.15
} // fine di interior -------------------
} // fine del materiale --------------------
//---------------------------------------
// modulazione del materiale Pigmento
#declare Pigment_01 =
pigment{ bumps
turbulence 0.30
scale <3,1,3>*0.12
translate<1,0,0>
} // fine del pigmento
//---------------------------------------
#declare Pigment_Function_01 =
function {
pigment { Pigment_01 }
} // fine della funzione
//---------------------------------------
// modulazione della funzione pigmento
isosurface {
function{
y
+Pigment_Function_01(x,y,z).gray*0.2
} //
contained_by{
box{<-Bordo,-Piscina_Y-1.01,-Bordo>,
< Piscina_X+Bordo,1, Piscina_Z+Bordo>
} //
} // fine di contained_by
accuracy 0.01
max_gradient 2
material{ Acqua_materiale }
// scalare the Pigment_01 se necessario!
transform Piscina_Transformation
} // fine di isosurface ------------------
Here is the picture resulted from the file:
Nessun commento:
Posta un commento