POV-Ray Raytracer Descriptions and Examples by Friedrich A. Lohmüller
Italiano Italiano
Français français
Deutsch Deutsch

macro "Column_N (...), Pyramid_N (...) " overview my macro objects macro "Facetted_Sphere (...)"

This shape is definded as "macro" in my include file "shapes_lo.inc":

Egg
Egg_Shape

Egg

Egg_Shape


   Egg object
 
general syntax:
object{ Egg
        texture{ ... ... }
        scale 1
        rotate <0,0,0>
        translate < 0, 0, 0>
     } // end of object ------------------------

   Egg Shape
 
general syntax:
object{ Egg_Shape (Lower_Scale, Upper_Scale)
        texture{ ... ... }
      } // end of object ------------------------
With:
Lower_Scale = y scale of the lower half of the shape,
Upper_Scale = y scale of the upper half of the shape.
The total height of these shapes is scaled to 2 units.

Samples:
#include "shapes_lo.inc"
object { Egg  // = Egg_Shape (1.15,1.55)
         texture{ pigment{ color rgb<1,1,1&lgt;}
                  normal { bumps 0.5 scale 0.0025}
                  finish { ambient 0.15 diffuse 0.85
                           phong 0.5 reflection 0.02}
                } // end of texture
        rotate < 0,0, 0>
        translate < 0,0, 0>
       } // end of object --------------------------- 
#include "shapes_lo.inc"
object { Egg_Shape (2.05,0.65)
         texture{ pigment{ color rgb<1,1,1>}
                  normal { bumps 0.5 scale 0.0025}
                  finish { ambient 0.15 diffuse 0.85
                           phong 1 reflection 0.02}
                } // end of texture
         translate < 0,0, 0>
       } // end of object --------------------------- 


Macro in detail

This macro is realisized by an union of two intersection of ellipsoids with according boxes:

// -------------------------------------- macro Egg_Shape (...)
#macro Egg_Shape (Lower_Scale, Upper_Scale)                  //
// ------------------------------------------------------------
#local Egg_Lower_Part =
         difference {
                      sphere{<0,0,0>,1 scale<1,Lower_Scale,1>}
                      box{<-1,0,-1>,<1,Lower_Scale,1>}
                    } //---------------------------------------
#local Egg_Upper_Part =
         difference {
                      sphere {<0,0,0>,1 scale<1,Upper_Scale,1>}
                      box {<-1,-Upper_Scale,-1>,<1,0,1>}
                     }//---------------------------------------
//-------------------------------------------------------------
  union {
          object {Egg_Upper_Part}
          object {Egg_Lower_Part}
          translate<0,Lower_Scale,0>
          scale 2/(Lower_Scale+Upper_Scale)

        } // end of union ------------------------------------
#end //---------------------------------- end of the egg macro

This Egg object is realisized by the same macro with fixed Lower_Scale = 1.15 and Upper_Scale = 1.55:

// ---------------------------- shape of a simple egg
#declare Egg = object { Egg_Shape (1.15,1.55)}
// ------------------------------------ end of the egg object


Here some variations of that macro:
 
Egg
Edd
"Egg object" "Egg object"


macro "Column_N (...), Pyramid_N (...) " overview my macro objects macro "Facetted_Sphere (...)"

© Friedrich A. Lohmüller, 2010
email email: (legacy email redacted)
homepage:www.f-lohmueller.de