For new raytraced stuff, I started learning human 3D modeling.
Here some picture of example of CGI.
Now it's time to improve the quality of the models created.
Un blog sul c++
In questo blog si parla di programmazione con il linguaggio C++, i post cercheranno di essere molto esplicativi sull'argomento trattato.
sabato 15 agosto 2015
mercoledì 5 agosto 2015
A coloumn in the water
A different picture created using a code with sea surface definition ad a new sky.
#version 3.6; // 3.7;
global_settings{ assumed_gamma 2.0
noise_generator 2 }
#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 // 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 , 2.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_0}
//radiosità-----------------------------------------------------------------
// sole-------------------------------------------------------------------
light_source{<-1500,2500,-2500> color White}
// cielo ---------------------------------------------------------------------
plane{<0,1,0>,1 hollow
texture{ pigment{ bozo turbulence 0.99
color_map { [0.5 rgb <0.30, 0.30, 1.0>*1]
[0.6 rgb <1,1,0.9>]
[1.0 rgb <0.2,0.2,0.2>]}
scale 3.5 translate<10,0,9>
}
finish {ambient 1 diffuse 0} }
scale 10000}
// nebbia ---------------------------------------------------------------------
fog{fog_type 2
distance 50
color White
fog_offset 0.1
fog_alt 2.0
turbulence 0.8}
//--------------------------------------------------------------------------
//---------------------------- oggetti in scena ----------------------------
//--------------------------------------------------------------------------
#declare Acqua_trama = texture{ Polished_Chrome }
// pigmento per la modulazione Isosurface
// e trama pigmento delle normali
#declare Pigmento_01 =
pigment { bumps
turbulence 0.17
scale <2,1,1>
} // fine pigmento
//---------------------------------------
#declare Pigmento_funzione_01 =
function {
pigment { Pigmento_01 }
} // fine della funzione
//---------------------------------------
// dimensioni x/z della scatola Isosurface
#local Scala_x = 20;
#local Scala_z = 14;
#local Iso_inizio =<-Scala_x,-1.0,-Scala_z>;
#local Iso_fine =< Scala_x, 1.0, Scala_z>;
//---------------------------------------
isosurface {
function{
y
-Pigmento_funzione_01(x, y, z).gray* 0.92
} //
contained_by { box {Iso_inizio,Iso_fine} }
accuracy 0.01
max_gradient 2
texture{ Polished_Chrome
normal { pigment_pattern { Pigmento_01 } }
}
// non scalare la Isosurface!
// scalare il Pigmento_01 se necessario!
translate <0, -0.3, 0>
} // fine di isosurface ------------------------
//---------------------------------------------
difference{ // ci allontaniamo dalla trama del pigmento
plane{<0,1,0>, 0 }
box { Iso_inizio,Iso_fine }
texture{
Acqua_trama
normal{
pigment_pattern{ Pigmento_01 }, 5}
}
translate<0,0.0,0>
}
// ------------------------------------------------------------- Nocciolo di colonna spezzata
// ---------------------------------------------------- "Macro Colonna_01( )
#macro Nocciolo_colonna_01 ( Nocciolo_colonna_altezza__, //
Colonna_suddivisione__, //
C_Raggio_base__,
C_Raggio_punta__
) //---------------------------------
//------------------------------------------------------------------------------------
#local Taglia_punta_r__ = 2*pi*C_Raggio_punta__ /Colonna_suddivisione__*1/sqrt(2);
#local Taglia_base_r__ = 2*pi*C_Raggio_base__/Colonna_suddivisione__*1/sqrt(2);
#local Taglia_punta_distanza__ = C_Raggio_punta__ +Taglia_punta_r__ *1/sqrt(2);
#local Taglia_base_distanza__= C_Raggio_base__ +Taglia_base_r__*1/sqrt(2);
#local R_fine_ = +Taglia_base_r__*0.1;
// -----------------------------------------------------------------------------------
difference{ // nocciolo della colonna
cone { <0,0,0>,C_Raggio_base__,<0,Nocciolo_colonna_altezza__,0>,C_Raggio_punta__
} // end of cone -----------------------------------
#local Nr = 0; // start
#local Fine_nr = Colonna_suddivisione__; // end
#while (Nr< Fine_nr)
cone{ <Taglia_base_distanza__,-R_fine_, 0>, Taglia_base_r__,
<Taglia_punta_distanza__ , Nocciolo_colonna_altezza__ + R_fine_,0>, Taglia_punta_r__
rotate<0,Nr * 360/Fine_nr,0>
} // fine del cono -----------------------------------
#local Nr = Nr + 1; // prossimo Nr
#end // --------------- fine del ciclo
} // fine differenza
#end //------------------------------------------------------------------ fine della macro
//------------------------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
#declare Trama_pietra = // Trama in pietra del nocciolo di colonna
texture { T_Grnt12
normal { agate 0.35 scale 0.05}
finish { phong 0.2 }
scale 1
} // fine della trama
#declare Trama_nocciolo_colonna = // suddivisioni verticali
texture { gradient<0,1,0> scale <1,0.67,1> turbulence 0.01
texture_map{ [0.00 Trama_pietra ]
[0.001 pigment{ color rgb <1,1,1>*0.1} ]
[0.005 pigment{ color rgb <1,1,1>*0.1} ]
[0.006 Trama_pietra ]
[1.00 Trama_pietra ]
} // end of texture_map
} // end of texture ------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
object{ Nocciolo_colonna_01 ( 2.0, // Column_Total_Height, //
16, // Column_Subdivision, // intero ~ 16
0.35, // Column_Base_Radius,
0.20 // Column_Top_Radius,
) //---------------------------------
texture { Trama_nocciolo_colonna}
scale<1,1,1> rotate< 0,0,0> translate<0,-0.4,1.2>
} // fine di "Colonna_01(...) ---------------------------------------
//------------------------------------------------------------------- end
Here is the picture genereated by the code.
#version 3.6; // 3.7;
global_settings{ assumed_gamma 2.0
noise_generator 2 }
#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 // 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 , 2.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_0}
//radiosità-----------------------------------------------------------------
// sole-------------------------------------------------------------------
light_source{<-1500,2500,-2500> color White}
// cielo ---------------------------------------------------------------------
plane{<0,1,0>,1 hollow
texture{ pigment{ bozo turbulence 0.99
color_map { [0.5 rgb <0.30, 0.30, 1.0>*1]
[0.6 rgb <1,1,0.9>]
[1.0 rgb <0.2,0.2,0.2>]}
scale 3.5 translate<10,0,9>
}
finish {ambient 1 diffuse 0} }
scale 10000}
// nebbia ---------------------------------------------------------------------
fog{fog_type 2
distance 50
color White
fog_offset 0.1
fog_alt 2.0
turbulence 0.8}
//--------------------------------------------------------------------------
//---------------------------- oggetti in scena ----------------------------
//--------------------------------------------------------------------------
#declare Acqua_trama = texture{ Polished_Chrome }
// pigmento per la modulazione Isosurface
// e trama pigmento delle normali
#declare Pigmento_01 =
pigment { bumps
turbulence 0.17
scale <2,1,1>
} // fine pigmento
//---------------------------------------
#declare Pigmento_funzione_01 =
function {
pigment { Pigmento_01 }
} // fine della funzione
//---------------------------------------
// dimensioni x/z della scatola Isosurface
#local Scala_x = 20;
#local Scala_z = 14;
#local Iso_inizio =<-Scala_x,-1.0,-Scala_z>;
#local Iso_fine =< Scala_x, 1.0, Scala_z>;
//---------------------------------------
isosurface {
function{
y
-Pigmento_funzione_01(x, y, z).gray* 0.92
} //
contained_by { box {Iso_inizio,Iso_fine} }
accuracy 0.01
max_gradient 2
texture{ Polished_Chrome
normal { pigment_pattern { Pigmento_01 } }
}
// non scalare la Isosurface!
// scalare il Pigmento_01 se necessario!
translate <0, -0.3, 0>
} // fine di isosurface ------------------------
//---------------------------------------------
difference{ // ci allontaniamo dalla trama del pigmento
plane{<0,1,0>, 0 }
box { Iso_inizio,Iso_fine }
texture{
Acqua_trama
normal{
pigment_pattern{ Pigmento_01 }, 5}
}
translate<0,0.0,0>
}
// ------------------------------------------------------------- Nocciolo di colonna spezzata
// ---------------------------------------------------- "Macro Colonna_01( )
#macro Nocciolo_colonna_01 ( Nocciolo_colonna_altezza__, //
Colonna_suddivisione__, //
C_Raggio_base__,
C_Raggio_punta__
) //---------------------------------
//------------------------------------------------------------------------------------
#local Taglia_punta_r__ = 2*pi*C_Raggio_punta__ /Colonna_suddivisione__*1/sqrt(2);
#local Taglia_base_r__ = 2*pi*C_Raggio_base__/Colonna_suddivisione__*1/sqrt(2);
#local Taglia_punta_distanza__ = C_Raggio_punta__ +Taglia_punta_r__ *1/sqrt(2);
#local Taglia_base_distanza__= C_Raggio_base__ +Taglia_base_r__*1/sqrt(2);
#local R_fine_ = +Taglia_base_r__*0.1;
// -----------------------------------------------------------------------------------
difference{ // nocciolo della colonna
cone { <0,0,0>,C_Raggio_base__,<0,Nocciolo_colonna_altezza__,0>,C_Raggio_punta__
} // end of cone -----------------------------------
#local Nr = 0; // start
#local Fine_nr = Colonna_suddivisione__; // end
#while (Nr< Fine_nr)
cone{ <Taglia_base_distanza__,-R_fine_, 0>, Taglia_base_r__,
<Taglia_punta_distanza__ , Nocciolo_colonna_altezza__ + R_fine_,0>, Taglia_punta_r__
rotate<0,Nr * 360/Fine_nr,0>
} // fine del cono -----------------------------------
#local Nr = Nr + 1; // prossimo Nr
#end // --------------- fine del ciclo
} // fine differenza
#end //------------------------------------------------------------------ fine della macro
//------------------------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
#declare Trama_pietra = // Trama in pietra del nocciolo di colonna
texture { T_Grnt12
normal { agate 0.35 scale 0.05}
finish { phong 0.2 }
scale 1
} // fine della trama
#declare Trama_nocciolo_colonna = // suddivisioni verticali
texture { gradient<0,1,0> scale <1,0.67,1> turbulence 0.01
texture_map{ [0.00 Trama_pietra ]
[0.001 pigment{ color rgb <1,1,1>*0.1} ]
[0.005 pigment{ color rgb <1,1,1>*0.1} ]
[0.006 Trama_pietra ]
[1.00 Trama_pietra ]
} // end of texture_map
} // end of texture ------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
object{ Nocciolo_colonna_01 ( 2.0, // Column_Total_Height, //
16, // Column_Subdivision, // intero ~ 16
0.35, // Column_Base_Radius,
0.20 // Column_Top_Radius,
) //---------------------------------
texture { Trama_nocciolo_colonna}
scale<1,1,1> rotate< 0,0,0> translate<0,-0.4,1.2>
} // fine di "Colonna_01(...) ---------------------------------------
//------------------------------------------------------------------- end
Here is the picture genereated by the code.
martedì 4 agosto 2015
A simple way to generate a greek coloumn
Here is the code to generate with Pov Ray a greek coloumn kernel.
#version 3.6; // 3.7;
global_settings{ assumed_gamma 2.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 // 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 , 2.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_0}
// sole-------------------------------------------------------------------
light_source{<-1500,2500,-2500> color White}
// cielo ---------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
color_map { [0.00 rgb <1.0,1.0,1.0>]
[0.30 rgb <0.0,0.15,1.0>]
[0.70 rgb <0.0,0.15,1.0>]
[1.00 rgb <1.0,1.0,1.0>]
}
scale 2
} // end of pigment
} //end of skysphere
// nebbia ---------------------------------------------------------------------
fog{fog_type 2
distance 50
color White
fog_offset 0.1
fog_alt 2.0
turbulence 0.8}
// terreno ------------------------------------------------------------------
plane{ <0,1,0>, 0
texture{ pigment{ color rgb <0.825,0.65,0.35>}
normal { bumps 0.95 scale 0.025 }
finish { phong 0.1 }
} // end of texture
} // end of plane
//--------------------------------------------------------------------------
//---------------------------- oggetti in scena ----------------------------
//--------------------------------------------------------------------------
// ------------------------------------------------------------- Nocciolo di colonna spezzata
// ---------------------------------------------------- "Macro Colonna_01( )
#macro Nocciolo_colonna_01 ( Nocciolo_colonna_altezza__, //
Colonna_suddivisione__, //
C_Raggio_base__,
C_Raggio_punta__
) //---------------------------------
//------------------------------------------------------------------------------------
#local Taglia_punta_r__ = 2*pi*C_Raggio_punta__ /Colonna_suddivisione__*1/sqrt(2);
#local Taglia_base_r__ = 2*pi*C_Raggio_base__/Colonna_suddivisione__*1/sqrt(2);
#local Taglia_punta_distanza__ = C_Raggio_punta__ +Taglia_punta_r__ *1/sqrt(2);
#local Taglia_base_distanza__= C_Raggio_base__ +Taglia_base_r__*1/sqrt(2);
#local R_fine_ = +Taglia_base_r__*0.1;
// -----------------------------------------------------------------------------------
difference{ // nocciolo della colonna
cone { <0,0,0>,C_Raggio_base__,<0,Nocciolo_colonna_altezza__,0>,C_Raggio_punta__
} // end of cone -----------------------------------
#local Nr = 0; // start
#local Fine_nr = Colonna_suddivisione__; // end
#while (Nr< Fine_nr)
cone{ <Taglia_base_distanza__,-R_fine_, 0>, Taglia_base_r__,
<Taglia_punta_distanza__ , Nocciolo_colonna_altezza__ + R_fine_,0>, Taglia_punta_r__
rotate<0,Nr * 360/Fine_nr,0>
} // fine del cono -----------------------------------
#local Nr = Nr + 1; // prossimo Nr
#end // --------------- fine del ciclo
} // fine differenza
#end //------------------------------------------------------------------ fine della macro
//------------------------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
#declare Trama_pietra = // Trama in pietra del nocciolo di colonna
texture { T_Grnt12
normal { agate 0.35 scale 0.05}
finish { phong 0.2 }
scale 1
} // fine della trama
#declare Trama_nocciolo_colonna = // suddivisioni verticali
texture { gradient<0,1,0> scale <1,0.67,1> turbulence 0.01
texture_map{ [0.00 Trama_pietra ]
[0.001 pigment{ color rgb <1,1,1>*0.1} ]
[0.005 pigment{ color rgb <1,1,1>*0.1} ]
[0.006 Trama_pietra ]
[1.00 Trama_pietra ]
} // end of texture_map
} // end of texture ------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
object{ Nocciolo_colonna_01 ( 2.5, // Column_Total_Height, //
32, // Column_Subdivision, // intero ~ 16
0.35, // Column_Base_Radius,
0.20 // Column_Top_Radius,
) //---------------------------------
texture { Trama_nocciolo_colonna}
scale<1,1,1> rotate< 0,0,0> translate<0,0,0>
} // fine di "Colonna_01(...) ---------------------------------------
//------------------------------------------------------------------- end
The resultant picture generated by the code written above.
#version 3.6; // 3.7;
global_settings{ assumed_gamma 2.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 // 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 , 2.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_0}
// sole-------------------------------------------------------------------
light_source{<-1500,2500,-2500> color White}
// cielo ---------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
color_map { [0.00 rgb <1.0,1.0,1.0>]
[0.30 rgb <0.0,0.15,1.0>]
[0.70 rgb <0.0,0.15,1.0>]
[1.00 rgb <1.0,1.0,1.0>]
}
scale 2
} // end of pigment
} //end of skysphere
// nebbia ---------------------------------------------------------------------
fog{fog_type 2
distance 50
color White
fog_offset 0.1
fog_alt 2.0
turbulence 0.8}
// terreno ------------------------------------------------------------------
plane{ <0,1,0>, 0
texture{ pigment{ color rgb <0.825,0.65,0.35>}
normal { bumps 0.95 scale 0.025 }
finish { phong 0.1 }
} // end of texture
} // end of plane
//--------------------------------------------------------------------------
//---------------------------- oggetti in scena ----------------------------
//--------------------------------------------------------------------------
// ------------------------------------------------------------- Nocciolo di colonna spezzata
// ---------------------------------------------------- "Macro Colonna_01( )
#macro Nocciolo_colonna_01 ( Nocciolo_colonna_altezza__, //
Colonna_suddivisione__, //
C_Raggio_base__,
C_Raggio_punta__
) //---------------------------------
//------------------------------------------------------------------------------------
#local Taglia_punta_r__ = 2*pi*C_Raggio_punta__ /Colonna_suddivisione__*1/sqrt(2);
#local Taglia_base_r__ = 2*pi*C_Raggio_base__/Colonna_suddivisione__*1/sqrt(2);
#local Taglia_punta_distanza__ = C_Raggio_punta__ +Taglia_punta_r__ *1/sqrt(2);
#local Taglia_base_distanza__= C_Raggio_base__ +Taglia_base_r__*1/sqrt(2);
#local R_fine_ = +Taglia_base_r__*0.1;
// -----------------------------------------------------------------------------------
difference{ // nocciolo della colonna
cone { <0,0,0>,C_Raggio_base__,<0,Nocciolo_colonna_altezza__,0>,C_Raggio_punta__
} // end of cone -----------------------------------
#local Nr = 0; // start
#local Fine_nr = Colonna_suddivisione__; // end
#while (Nr< Fine_nr)
cone{ <Taglia_base_distanza__,-R_fine_, 0>, Taglia_base_r__,
<Taglia_punta_distanza__ , Nocciolo_colonna_altezza__ + R_fine_,0>, Taglia_punta_r__
rotate<0,Nr * 360/Fine_nr,0>
} // fine del cono -----------------------------------
#local Nr = Nr + 1; // prossimo Nr
#end // --------------- fine del ciclo
} // fine differenza
#end //------------------------------------------------------------------ fine della macro
//------------------------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
#declare Trama_pietra = // Trama in pietra del nocciolo di colonna
texture { T_Grnt12
normal { agate 0.35 scale 0.05}
finish { phong 0.2 }
scale 1
} // fine della trama
#declare Trama_nocciolo_colonna = // suddivisioni verticali
texture { gradient<0,1,0> scale <1,0.67,1> turbulence 0.01
texture_map{ [0.00 Trama_pietra ]
[0.001 pigment{ color rgb <1,1,1>*0.1} ]
[0.005 pigment{ color rgb <1,1,1>*0.1} ]
[0.006 Trama_pietra ]
[1.00 Trama_pietra ]
} // end of texture_map
} // end of texture ------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
object{ Nocciolo_colonna_01 ( 2.5, // Column_Total_Height, //
32, // Column_Subdivision, // intero ~ 16
0.35, // Column_Base_Radius,
0.20 // Column_Top_Radius,
) //---------------------------------
texture { Trama_nocciolo_colonna}
scale<1,1,1> rotate< 0,0,0> translate<0,0,0>
} // fine di "Colonna_01(...) ---------------------------------------
//------------------------------------------------------------------- end
The resultant picture generated by the code written above.
domenica 2 agosto 2015
Brickwall creation with POV Ray
Following this simple code, you can create a small brick wall covered by a layer of stucco. The stucco could be ruined and aged using only a parameter of a Macro. Here is the code:
#version 3.7;
global_settings { assumed_gamma 1.0
noise_generator 2 } // modificare in 2 o 3
light_source {
< 800, 800,-800>
rgb 1
}
camera {
location <0.2, 0.0,-28.0>
look_at <0.0, 0.0, 0.0>
right x*image_width/image_height // mantenere le proporzioni dell'immagine
angle 65
}
//====== Preparare lo stucco Stucco ======
#declare L2=0.33; //clock; //Set amount of decay of stucco, higher value is more decay. animate
#declare PRugoso= pigment { //Cemento
wrinkles
scale 0.25
colour_map {
[0, rgb 0.5]
[L2, rgb 0.89]
}
}
#declare Stucco= pigment { //Stucco
granite
scale 0.15
colour_map {
[0, rgb 0.96]
[1, rgb 1]
}
}
#declare Stucem= pigment { //Stucco & Cemento
pigment_pattern{
wrinkles
scale 0.25
}
pigment_map {
[L2, PRugoso]
[L2, Stucco]
}
}
#declare HF_Stucco=height_field { //Viene trasformato in hightfield
function 1000, 1000{ //500,500 per il test, valori superiori vanno meglio ma controllare la memoria
pigment{Stucem }
}
translate -0.5
rotate -90*x
scale <20,20,2>
pigment { //Usare il cemento per colorare lo stucco
pigment_pattern {
wrinkles
scale 0.25
}
color_map {
[L2, rgb 0.5]
[L2, rgb <1,1,0.95>]
}
warp {planar z, 0}
translate <-0.5, -0.5, 0>
rotate <180,0,0>
scale <40,40,2>
}
}
//====== Mettere alcuni mattoni ======
//Taglia : dimensioni del mattone nel vettore x, y, z
//Cemento : larghezza della giunzione.
//Turbolenza etc : controlla la deformazione della pietra.
#macro Muromatt(Taglia, Cemento, Turbolenza, Octaves, Lambda, Omega)
#local Mattone= pigment {
boxed // un mattone singolo ...
scale <Taglia.x/2,Taglia.y/2,Taglia.z/2>
translate <Taglia.x/2+Cemento,Taglia.y/2+Cemento,0>
warp {repeat x*(Taglia.x+Cemento)} // ... ripetuto molte volte.
warp {repeat y*(2*(Taglia.y+Cemento))}
}
#declare FMuromatt= function {
pigment {
pigment_pattern {
gradient y
warp {repeat y}
scale <1,2*(Taglia.y+Cemento),1>
}
pigment_map {
[0.5, Mattone
warp { // deformare i mattoni ...
turbulence Turbolenza
octaves Octaves
lambda Lambda
omega Omega
}
translate <0,-(Cemento/2),0>
]
[0.5, Mattone // ... riga per riga.
warp {
turbulence Turbolenza
octaves Octaves
lambda Lambda
omega Omega
}
translate <(Taglia.x/2)+Cemento,(Taglia.y+(Cemento/2)),0>
]
}
}
}
#end
#declare Parete=pigment {
Muromatt(<4,1.25,1>,0.3,<0.15,0.1,0>,6,0.7,0.5)
function{FMuromatt(x,y,z).gray}
pigment_map { // dare struttura ai giunti ...
[0, granite
scale 0.1
colour_map {
[0, rgb 0][1, rgb 0.3]
}
]
[0.05, crackle // ... e ai mattoni.
scale <3,1,1>
turbulence 0.5
colour_map {
[0, rgb 0.34][1, rgb 0.5]
}
]
}
scale 0.04
}
#declare HF_Parete=height_field { // Costruire la parete
function 1000, 1000 { //500,500 per il test, valori superiori vanno meglio, ma controllare la memoria
pigment{Parete}
}
smooth
translate -0.5
rotate <-90,0,0>
scale <33,33,1>
pigment {
Parete
pigment_map {
[0, rgb 0.6]
[0.05, wrinkles
turbulence 0.3
scale <2,0.3,1>
colour_map {
[0.0, rgb <0.5,0.3,0.25>]
[0.15, rgb <0.5,0.3,0.25>/1.3]
[0.3, rgb <0.5,0.3,0.25>]
[0.6, rgb <0.6,0.3,0.25>/1.6]
[0.8, rgb <0.5,0.3,0.25>]
[1.0, rgb <0.5,0.3,0.35>/2]
}
]
}
translate <-0.5, -0.5, 0>
rotate -90*x
warp {planar y, 0}
scale <33,33,1>
}
}
object {HF_Stucco}
object {HF_Parete translate <0,0,-0.75>}
And the picture generated by the code written above.
#version 3.7;
global_settings { assumed_gamma 1.0
noise_generator 2 } // modificare in 2 o 3
light_source {
< 800, 800,-800>
rgb 1
}
camera {
location <0.2, 0.0,-28.0>
look_at <0.0, 0.0, 0.0>
right x*image_width/image_height // mantenere le proporzioni dell'immagine
angle 65
}
//====== Preparare lo stucco Stucco ======
#declare L2=0.33; //clock; //Set amount of decay of stucco, higher value is more decay. animate
#declare PRugoso= pigment { //Cemento
wrinkles
scale 0.25
colour_map {
[0, rgb 0.5]
[L2, rgb 0.89]
}
}
#declare Stucco= pigment { //Stucco
granite
scale 0.15
colour_map {
[0, rgb 0.96]
[1, rgb 1]
}
}
#declare Stucem= pigment { //Stucco & Cemento
pigment_pattern{
wrinkles
scale 0.25
}
pigment_map {
[L2, PRugoso]
[L2, Stucco]
}
}
#declare HF_Stucco=height_field { //Viene trasformato in hightfield
function 1000, 1000{ //500,500 per il test, valori superiori vanno meglio ma controllare la memoria
pigment{Stucem }
}
translate -0.5
rotate -90*x
scale <20,20,2>
pigment { //Usare il cemento per colorare lo stucco
pigment_pattern {
wrinkles
scale 0.25
}
color_map {
[L2, rgb 0.5]
[L2, rgb <1,1,0.95>]
}
warp {planar z, 0}
translate <-0.5, -0.5, 0>
rotate <180,0,0>
scale <40,40,2>
}
}
//====== Mettere alcuni mattoni ======
//Taglia : dimensioni del mattone nel vettore x, y, z
//Cemento : larghezza della giunzione.
//Turbolenza etc : controlla la deformazione della pietra.
#macro Muromatt(Taglia, Cemento, Turbolenza, Octaves, Lambda, Omega)
#local Mattone= pigment {
boxed // un mattone singolo ...
scale <Taglia.x/2,Taglia.y/2,Taglia.z/2>
translate <Taglia.x/2+Cemento,Taglia.y/2+Cemento,0>
warp {repeat x*(Taglia.x+Cemento)} // ... ripetuto molte volte.
warp {repeat y*(2*(Taglia.y+Cemento))}
}
#declare FMuromatt= function {
pigment {
pigment_pattern {
gradient y
warp {repeat y}
scale <1,2*(Taglia.y+Cemento),1>
}
pigment_map {
[0.5, Mattone
warp { // deformare i mattoni ...
turbulence Turbolenza
octaves Octaves
lambda Lambda
omega Omega
}
translate <0,-(Cemento/2),0>
]
[0.5, Mattone // ... riga per riga.
warp {
turbulence Turbolenza
octaves Octaves
lambda Lambda
omega Omega
}
translate <(Taglia.x/2)+Cemento,(Taglia.y+(Cemento/2)),0>
]
}
}
}
#end
#declare Parete=pigment {
Muromatt(<4,1.25,1>,0.3,<0.15,0.1,0>,6,0.7,0.5)
function{FMuromatt(x,y,z).gray}
pigment_map { // dare struttura ai giunti ...
[0, granite
scale 0.1
colour_map {
[0, rgb 0][1, rgb 0.3]
}
]
[0.05, crackle // ... e ai mattoni.
scale <3,1,1>
turbulence 0.5
colour_map {
[0, rgb 0.34][1, rgb 0.5]
}
]
}
scale 0.04
}
#declare HF_Parete=height_field { // Costruire la parete
function 1000, 1000 { //500,500 per il test, valori superiori vanno meglio, ma controllare la memoria
pigment{Parete}
}
smooth
translate -0.5
rotate <-90,0,0>
scale <33,33,1>
pigment {
Parete
pigment_map {
[0, rgb 0.6]
[0.05, wrinkles
turbulence 0.3
scale <2,0.3,1>
colour_map {
[0.0, rgb <0.5,0.3,0.25>]
[0.15, rgb <0.5,0.3,0.25>/1.3]
[0.3, rgb <0.5,0.3,0.25>]
[0.6, rgb <0.6,0.3,0.25>/1.6]
[0.8, rgb <0.5,0.3,0.25>]
[1.0, rgb <0.5,0.3,0.35>/2]
}
]
}
translate <-0.5, -0.5, 0>
rotate -90*x
warp {planar y, 0}
scale <33,33,1>
}
}
object {HF_Stucco}
object {HF_Parete translate <0,0,-0.75>}
And the picture generated by the code written above.
lunedì 15 giugno 2015
Unity 3D training
I started 1 year ago my training using the Unity 3D software to develop videogames using C#.
I attach an image of a videogame developed in few weeks using this software. The game is called Corridore, is an easy infinite runner.
I attach an image of a videogame developed in few weeks using this software. The game is called Corridore, is an easy infinite runner.
sabato 4 aprile 2015
A small reflective box
Here we show the code to generate a reflective box that simulate mirrors, these generates infinite reflection of objects inside the box.
#version 3.7;
global_settings {
assumed_gamma 1.0
max_trace_level 25
}
#default {finish {ambient 0}}
#include "colors.inc"
#include "stones.inc"
//-------------------------------------------
#declare CamLoc = < 1.5, 3.5,-7>;
camera {
location CamLoc
up y*image_height/image_width right x
look_at < 0, 1, 0>
angle 35
}
light_source {CamLoc, color rgb 0.3}
light_source {<-50, 150,-180>, color White}
light_source {< 20, 25, 75>, color rgb 0.5}
//*******************************************
box {<-50,-1,-50>, < 50, 0, 50>
texture {
pigment {checker color rgb < 0.15, 0.1, 0.5>, color White}
}
}
#declare Bordorag = 0.05;
union {
box {<-1, 0,-1>, < 1, 2, 1>
texture {
pigment {color White filter 1}
}
interior_texture {
pigment {color rgb 0}
finish {reflection 0.85}
}
no_shadow
}
cylinder {<-1, 0,-1>, < 1, 0,-1>, Bordorag}
cylinder {< 1, 0,-1>, < 1, 0, 1>, Bordorag}
cylinder {< 1, 0, 1>, <-1, 0, 1>, Bordorag}
cylinder {<-1, 0, 1>, <-1, 0,-1>, Bordorag}
cylinder {<-1, 2,-1>, < 1, 2,-1>, Bordorag}
cylinder {< 1, 2,-1>, < 1, 2, 1>, Bordorag}
cylinder {< 1, 2, 1>, <-1, 2, 1>, Bordorag}
cylinder {<-1, 2, 1>, <-1, 2,-1>, Bordorag}
cylinder {<-1, 0,-1>, <-1, 2,-1>, Bordorag}
cylinder {< 1, 0,-1>, < 1, 2,-1>, Bordorag}
cylinder {< 1, 0, 1>, < 1, 2, 1>, Bordorag}
cylinder {<-1, 0, 1>, <-1, 2, 1>, Bordorag}
sphere {<-1, 0,-1>, Bordorag*2}
sphere {< 1, 0,-1>, Bordorag*2}
sphere {< 1, 0, 1>, Bordorag*2}
sphere {<-1, 0, 1>, Bordorag*2}
sphere {<-1, 2,-1>, Bordorag*2}
sphere {< 1, 2,-1>, Bordorag*2}
sphere {< 1, 2, 1>, Bordorag*2}
sphere {<-1, 2, 1>, Bordorag*2}
texture {
pigment {color Red}
}
translate y*Bordorag
}
sphere {< 0.3, 1.5, 0.4>, 0.35
texture {
pigment {color rgb < 0.5, 0, 0>}
finish {
reflection {0.5 metallic}
diffuse 0.4
brilliance 2
specular 1 roughness 0.01
metallic
}
}
}
sphere {<-0.5, 0.5,-0.2>, 0.1
texture {
pigment {color rgb < 1, 1, 0>}
finish {
reflection {0.5 metallic}
diffuse 0.4
brilliance 2
specular 1 roughness 0.01
metallic
}
}
}
box {<-0.3,-0.1,-0.2>, < 0.5, 0.1, 0.2>
texture { T_Grnt5
//normal { agate 0.15 scale 0.15}
finish { phong 0.5 }
scale 1
} // end of texture
translate < 0.5, 0.3,-0.5>
}
//-------------------------------------------
Here is the picture generated by the code:
#version 3.7;
global_settings {
assumed_gamma 1.0
max_trace_level 25
}
#default {finish {ambient 0}}
#include "colors.inc"
#include "stones.inc"
//-------------------------------------------
#declare CamLoc = < 1.5, 3.5,-7>;
camera {
location CamLoc
up y*image_height/image_width right x
look_at < 0, 1, 0>
angle 35
}
light_source {CamLoc, color rgb 0.3}
light_source {<-50, 150,-180>, color White}
light_source {< 20, 25, 75>, color rgb 0.5}
//*******************************************
box {<-50,-1,-50>, < 50, 0, 50>
texture {
pigment {checker color rgb < 0.15, 0.1, 0.5>, color White}
}
}
#declare Bordorag = 0.05;
union {
box {<-1, 0,-1>, < 1, 2, 1>
texture {
pigment {color White filter 1}
}
interior_texture {
pigment {color rgb 0}
finish {reflection 0.85}
}
no_shadow
}
cylinder {<-1, 0,-1>, < 1, 0,-1>, Bordorag}
cylinder {< 1, 0,-1>, < 1, 0, 1>, Bordorag}
cylinder {< 1, 0, 1>, <-1, 0, 1>, Bordorag}
cylinder {<-1, 0, 1>, <-1, 0,-1>, Bordorag}
cylinder {<-1, 2,-1>, < 1, 2,-1>, Bordorag}
cylinder {< 1, 2,-1>, < 1, 2, 1>, Bordorag}
cylinder {< 1, 2, 1>, <-1, 2, 1>, Bordorag}
cylinder {<-1, 2, 1>, <-1, 2,-1>, Bordorag}
cylinder {<-1, 0,-1>, <-1, 2,-1>, Bordorag}
cylinder {< 1, 0,-1>, < 1, 2,-1>, Bordorag}
cylinder {< 1, 0, 1>, < 1, 2, 1>, Bordorag}
cylinder {<-1, 0, 1>, <-1, 2, 1>, Bordorag}
sphere {<-1, 0,-1>, Bordorag*2}
sphere {< 1, 0,-1>, Bordorag*2}
sphere {< 1, 0, 1>, Bordorag*2}
sphere {<-1, 0, 1>, Bordorag*2}
sphere {<-1, 2,-1>, Bordorag*2}
sphere {< 1, 2,-1>, Bordorag*2}
sphere {< 1, 2, 1>, Bordorag*2}
sphere {<-1, 2, 1>, Bordorag*2}
texture {
pigment {color Red}
}
translate y*Bordorag
}
sphere {< 0.3, 1.5, 0.4>, 0.35
texture {
pigment {color rgb < 0.5, 0, 0>}
finish {
reflection {0.5 metallic}
diffuse 0.4
brilliance 2
specular 1 roughness 0.01
metallic
}
}
}
sphere {<-0.5, 0.5,-0.2>, 0.1
texture {
pigment {color rgb < 1, 1, 0>}
finish {
reflection {0.5 metallic}
diffuse 0.4
brilliance 2
specular 1 roughness 0.01
metallic
}
}
}
box {<-0.3,-0.1,-0.2>, < 0.5, 0.1, 0.2>
texture { T_Grnt5
//normal { agate 0.15 scale 0.15}
finish { phong 0.5 }
scale 1
} // end of texture
translate < 0.5, 0.3,-0.5>
}
//-------------------------------------------
Here is the picture generated by the code:
sabato 21 marzo 2015
A simple way to create a dust whirpool
Here we show how to create a simple picture of a dust whirpool, using the scattering media materials generated by POV Ray.
#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_posizione = < 0.00, 1.70,-5.50>; // vista frontale
#declare Camera_guarda_a = < 0.00, 3.2, 0.00>;
#declare CAmera_angolo = 55 ; // in gradi
//--------------------------------------------------------------------------------------------------------<<<<
camera{ /*ultra_wide_angle*/
location CAmera_posizione
right x*image_width/image_height
angle CAmera_angolo
look_at Camera_guarda_a
}
//------------------------------------------------------------------------------------------------------<<<<<
//------------------------------------------------------------------------------------------------------<<<<<
// sole ---------------------------------------------------------------------
light_source{<1500,2500,-2500> color White*0.85}
// cielo ---------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
color_map { [0.00 rgb <1.0,1.0,1.0>*0.5]
[0.30 rgb <0.4,0.4,1.0>*0.5]
[0.75 rgb <0.4,0.4,1.0>*0.5]
[1.00 rgb <1.0,1.0,1.0>*0.5]
}
scale 3
}
} //fine del cielo
// nebbia ---------------------------------------------------------------------
fog{fog_type 2
distance 50
color White*0.5
fog_offset 0.1
fog_alt 2.0
turbulence 0.8}
// terreno ------------------------------------------------------------------
plane{ <0,1,0>, 0
texture{ pigment{ color rgb <1.00,0.95,0.85>*0.5}
normal { bumps 0.95 scale 0.025 }
finish { phong 0.1 }
} //fine della trama
} // fine del piano
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//---------------------------- oggetto in scena ----------------------------
//--------------------------------------------------------------------------
// oggetto di diffusione della luce "tornado di polvere"
cylinder{ <0,0,0>,<0,100,0>,1.5
pigment { rgbt 1 }
hollow
interior{ //---------------------
media{ scattering{ 1, <1,1,1>
extinction 2.5 }
absorption rgb< 0.65, 0.89, 0.89>*2
// densità 1
density{ spiral2 8
turbulence 0.25
color_map {
[0.00 rgb 0.00] // bordo
[0.50 rgb 0.20] //
[1.00 rgb 1.00] // centro
} // fine della color_map
rotate<90,0,0>
scale<1,0.5,1>
} // fine della densità 1
// densità 2
density{ cylindrical
turbulence 1.5
frequency 1
color_map {
[0.00 rgb 0.00] // bordo
[0.50 rgb 0.25] //
[0.85 rgb 1.00] //
[1.00 rgb 0.50] // centro
} // end color_map
scale<1,1,1>
} // fine della densità 2
}
} // fine dell'interior
rotate<0,0,-25>
translate < 0.00, 0.15, 0.5>
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
Here is the picture generated by the code:
#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_posizione = < 0.00, 1.70,-5.50>; // vista frontale
#declare Camera_guarda_a = < 0.00, 3.2, 0.00>;
#declare CAmera_angolo = 55 ; // in gradi
//--------------------------------------------------------------------------------------------------------<<<<
camera{ /*ultra_wide_angle*/
location CAmera_posizione
right x*image_width/image_height
angle CAmera_angolo
look_at Camera_guarda_a
}
//------------------------------------------------------------------------------------------------------<<<<<
//------------------------------------------------------------------------------------------------------<<<<<
// sole ---------------------------------------------------------------------
light_source{<1500,2500,-2500> color White*0.85}
// cielo ---------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
color_map { [0.00 rgb <1.0,1.0,1.0>*0.5]
[0.30 rgb <0.4,0.4,1.0>*0.5]
[0.75 rgb <0.4,0.4,1.0>*0.5]
[1.00 rgb <1.0,1.0,1.0>*0.5]
}
scale 3
}
} //fine del cielo
// nebbia ---------------------------------------------------------------------
fog{fog_type 2
distance 50
color White*0.5
fog_offset 0.1
fog_alt 2.0
turbulence 0.8}
// terreno ------------------------------------------------------------------
plane{ <0,1,0>, 0
texture{ pigment{ color rgb <1.00,0.95,0.85>*0.5}
normal { bumps 0.95 scale 0.025 }
finish { phong 0.1 }
} //fine della trama
} // fine del piano
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//---------------------------- oggetto in scena ----------------------------
//--------------------------------------------------------------------------
// oggetto di diffusione della luce "tornado di polvere"
cylinder{ <0,0,0>,<0,100,0>,1.5
pigment { rgbt 1 }
hollow
interior{ //---------------------
media{ scattering{ 1, <1,1,1>
extinction 2.5 }
absorption rgb< 0.65, 0.89, 0.89>*2
// densità 1
density{ spiral2 8
turbulence 0.25
color_map {
[0.00 rgb 0.00] // bordo
[0.50 rgb 0.20] //
[1.00 rgb 1.00] // centro
} // fine della color_map
rotate<90,0,0>
scale<1,0.5,1>
} // fine della densità 1
// densità 2
density{ cylindrical
turbulence 1.5
frequency 1
color_map {
[0.00 rgb 0.00] // bordo
[0.50 rgb 0.25] //
[0.85 rgb 1.00] //
[1.00 rgb 0.50] // centro
} // end color_map
scale<1,1,1>
} // fine della densità 2
}
} // fine dell'interior
rotate<0,0,-25>
translate < 0.00, 0.15, 0.5>
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
Here is the picture generated by the code:
Iscriviti a:
Post (Atom)