Descrizioni ed esempi per il raytracer POV-Ray di Friedrich A. Lohmüller
Oggetti Geometrici di POV-Ray
English English English
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
Oggetti Geometrici
  Indice

Oggetti in "shapes3.inc"
- Segment_of_CylinderRing
- Segment_of_Torus
- Segment_of_Object
- Egg
- Egg_Shape
>Facetted_Egg
>Facetted_Egg_Shape
- Facetted_Sphere
- Ring_Sphere
- Column_N
- Column_N_AB
- Pyramid_N
- Pyramid_N_AB
- Round_Pyramid_N_out
- Round_Pyramid_N_in
- Round_Cylinder_Tube
- Rounded_Tube_AB
- Rounded_Tube
- Round_N_Tube_Polygon
- Round_Conic_Torus
- Round_Conic_Prism
- Half_Hollowed_Rounded_Cyl1
- Half_Hollowed_Rounded_Cyl2

 
                                       
Questo oggetto è definito con una macro nel mio include file "shapes3.inc" ( precedentemente "shapes_lo.inc" ).
Facetted_Egg
Facetted_Egg
Uovo sfaccettaturato
Sintassi generale:
object{ Facetted_Egg(
          Quarter_Meridian_Segments,
          Equatorial_Segments
        ) //------------------------
        texture{ ... ... }
      } // end of object -----------

Facetted_Egg_Shape
Facetted_Egg_Shape
Forma d'uovo sfaccettaturato
Sintassi generale:
object{ Facetted_Egg_Shape(
          Quarter_Meridian_Segments,
          Equatorial_Segments,
          Lower_Scale, Upper_Scale
        ) //-----------------------
        texture{ ... ... }
      } // end of object -----------
Quarter_Meridian_Segments = il numero di sfaccettature in un quarto del meridiano,
Equatorial_Segments = il numero di sfaccettature lungo l'equatore e
Lower_Scale = la scale y della parte inferiore del'oggetto,
Upper_Scale = la scale y della parte superiore del'oggetto.
L'altezza totale della silhouette è in scala di 2 unità.
Esempi:
#include "shapes3.inc"
object{ Facetted_Egg (6, 12 )
        texture{ pigment{ color rgb<1,1,1>}
                 finish { phong 0.1}
               }
        scale 1 rotate<0,10,0>
        translate<0,1.15,0>
      } // end of object -----------------------
#include "shapes3.inc"
object{ Facetted_Egg_Shape (9, 22, 1.85, 0.80)
        texture{ pigment {color rgb<1,1,1>*1.3}
                 finish { phong 0.1}
               }
        scale 1 rotate<0,10,0>
        translate<0,1.85,0>
      } // end of object -----------------------


Macro nel dettaglio
Questa macro è realizzato con un'intersezione di prismi con la silhouette in forma d'uovo sfaccettaturato a una fine:
Facetted_Sphere
Facetted_Sphere
Facetted_Sphere - 1 prism element of the intersection
Facetted_Sphere (6, 12 ) = intersection of 12 prisms

//------------------------ macro Facetted_Egg_Shape()
#macro Facetted_Egg_Shape( Quarter_Segments,
                           Radial_Segments,
                           Lower_Scale,
                           Upper_Scale
                         ) //-----------------------
#local Facets_Silhouette =
union{
 prism {
   -2 ,2 ,  Quarter_Segments +3
   < -2,-1.00>,
 #local Nr    =  -Quarter_Segments;
 #local EndNr =  0;
 #while (Nr < EndNr+1)
   #local Angle_degrees = Nr* 90/Quarter_Segments;
   #local Angle_radians = radians(Angle_degrees);
   < cos (Angle_radians) , sin (Angle_radians)> ,
 #local Nr = Nr + 1 ;
 #end
   < -2, 0>
 //turns prism in z direction:
 rotate <-90,0,0> scale <1,1,-1>
 scale <1,Lower_Scale,1>
 } // end of prism object --------------------------

 prism {
  -2 ,2 , Quarter_Segments+4
  < -2, 0>,
  #local Nr    =  0;
  #local EndNr =  Quarter_Segments;
  #while (Nr < EndNr+1)
   #local Angle_degrees = Nr* 90/Quarter_Segments;
   #local Angle_radians = radians(Angle_degrees);
  < cos (Angle_radians) , sin (Angle_radians)> ,
  #local Nr = Nr + 1 ;
  #end
  < -2, 1>,
  < -2, 0>
  //turns prism in z direction:
 rotate <-90,0,0> scale <1,1,-1>
 scal e<1,Upper_Scale,1>
 } // end of prism object -----------------------
}// end of union

intersection{
 #local Nr = 0;                  // start
 #local EndNr = Radial_Segments; // end
 #while (Nr < EndNr)

 object{ Facets_Silhouette rotate <0,Nr * 360/EndNr,0>}

 #local Nr = Nr + 1;    // next Nr
 #end // ---------------  end of loop
} // end of intersection

#end // --------- end of macro Facetted_Egg_Shape()
La macro "Facetted_Egg" è realizzato con lo stesso macro a scala fissa: Lower_Scale = 1.15 e Upper_Scale = 1.55:
// ------------------------------------------------- macro Facetted_Egg()
#macro Facetted_Egg(N_Quarter_Segments, N_Radial_Segments)
object{ Facetted_Egg_Shape(N_Quarter_Segments,N_Radial_Segments,1.15,1.55)
        translate < 0, 1.15, 0>
        scale 2/(1.15 + 1.55)
      } //---------------------
#end // -------------------------------------- end of macro Facetted_Egg()

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