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

Home
- POV-Ray Tutorial

  Loops in POV-Ray
  1. For + While
       Comparison
  2. Linear
      Transformations
  3. Circular
      Transformations
  4. Moebius etc.
  5. Screws
       & Spirals
  6. Twisting
       Spirals
>7. Snails
       & Ammonites
  8. Spherical Spirals 1
  9. Spherical Spirals 2
 10. Fibonacci Spirals
                                       
 
 
  - Download

Loops for Snails and Ammonites

In the last exsamples of a spiral the spheres had always the same size. Now we will see how to reduce continually the size of the spheres, the radius and the height of the screwing of a snail:

//-------------------------------------
#declare Ball =
sphere{<0,0,0>,0.5
     texture{pigment{color
                     rgb<1,0.65,0.0>}
             finish {phong 1}}}
#declare Radius0=3.0;// basic radius
#declare NR=9;//number of revolutions
#declare NpR=100;//number elements p.r.
#declare Scale=0.75; //per revolution
#declare HpR=0.8;//difference in y p.r.
//-------------------------------------
#local Hd       = HpR/NpR;
#local Scale_p  = pow(Scale,1/360);
#local Scale_pE = pow(Scale_p,360/NpR);
#local Old_S = Scale_pE;
#local Old_H = Hd;
#declare Nr = 0;         //start
#declare EndNr = NR*NpR; //  end
#while (Nr< EndNr)
 object{Ball
        translate<Radius0,0,0>
        scale Old_S
        translate<0,Old_H,0>
        rotate<0,Nr*360/NpR,0>}
 #declare Nr = Nr+1;  // next Nr
 #declare Old_S =Scale_pE*Old_S;
 #declare Old_H =Old_H+Hd*Old_S;
#end // ------------ end of loop -----
Scene file for POV-Ray: povloopa.pov
or: povloopa.txt

If we reduce the height of the screwing to zero,
we get the classic form of
"Ammonitus povrayensis":

//-----------------------------------
#declare Ball =
 sphere{<0,0,0>,1.0
        texture{...see above...}}}
#declare Radius0     = 3.5;
#declare NR = 9;//number of revolutions
#declare NpR=50;//number of elem.p.r.
#declare Scale = 0.55; //per revolution
#declare HpR   = 0.00;
//------------------------------------
Scene file for POV-Ray: povloopb.pov
or: povloopb.txt

By scaling the shape of the basic element and texturing it with stone or granit textures it is possible to form nearly every shape of a snailhouse or ammonite you wish: For example: what about a
"Turritella turris var. povensis"?

//---------------------------------
#declare Ball =
sphere{<0,0,0>,0.70
       scale <1,1.5,1>
       texture{T_Stone3 scale 1.5
               finish {phong 0.3}}}
#declare Radius0 = 1.5;
#declare NR=9.1;
//number of revolutions
#declare NpR = 30;
//number of elements per revolution
#declare Scale=0.78;
//per revolution
#declare HpR    = 1.6;
//---------------------------------
Scene file for POV-Ray: povloopc.pov or: povloopc.txt


top

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