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.
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.
Iscriviti a:
Post (Atom)