Descriptions and Samples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    deutsche Version

Yin and Yang overview Egg - part 2

Egg

The construction of an egg shape.

Objects:    "box", "sphere".
Methods: "intersection", "difference", "declare" , "union"
View from frontside (View in z-direction)

Construction in details:

The common parts (= intersection) of a sphere respectivly of an ellipsoid (light gray) and a box (darkgray) form a hemisphere (lower half of the egg) respectivly a half ellipsoid (upper half of the egg). Both half parts are connected by a "union" to the complet shape of the egg.
The same effect you can get with the use of "difference" with the boxes mirrowed by the xz-plane.
//---------------------------------------------------------------------
#declare Egg_Tex =                            //  <-----1
   texture{pigment{color White}
           normal {bumps 0.4 scale 0.01}
           finish {ambient 0.15 diffuse 0.85 phong 0.1}}
//-------------------------------------------//  <-----2  -------------
#declare Egg_upperpart =                 //alternativ with "difference":
intersection{                      //difference{
 sphere{<0,0,0>,1 scale<1,1.75,1>} // sphere{<0,0,0>,1 scale<1,1.75,1>}
 box{<-1,0,-1>,<1,1.75,1>}         // box{<-1,-1.75,-1>,<1,0,1>}
 }//-------------------------------------------------------------------
#declare Egg_lowerpart =                
intersection{                      //difference{
 sphere{<0,0,0>,1 scale<1,1,1>}    // sphere{<0,0,0>,1 scale<1,1,1>}
 box{<-1,-1,-1>,<1,0,1>}           // box{<-1,0,-1>,<1,1,1>}
 }//-------------------------------------------------------------------
#declare Egg =
union{ object{Egg_upperpart}
       object{Egg_lowerpart}
       texture{Egg_Tex}
 }//-------------------------------------------------------------------
object{ Egg_upperpart translate<-1.1,1.1,0>        //  <----3
        texture{Egg_Tex}}
object{ Egg_lowerpart translate<-1.1,0.9,0>
        texture{Egg_Tex}}
object{ Egg       translate< 1.1,1.0,0>}
//------------------------------------------------------------ end ----

This produces the following image:

Sample Egg 600x450
Click here for the complete scene description for POV-Ray:
".txt" file or ".pov" file

Yin and Yang overview Egg - part 2

© Friedrich A. Lohmüller, 2003     email email: (legacy email redacted)