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. Loops 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

Spherical Spirals 1

Circular transformations on the surface of a sphere:
#declare Element =
sphere{ <0,0,0>,0.05
        texture{
          pigment{ color rgb<0.7,0,0>}
          finish { phong 1
            reflection{0.3 metallic 0.5}}
               } // end texture
} // end sphere -----------------------
union{ //------------------------------
 // spiral ----------------------------
 #local Nr =  0;      // start
 #local End = 6000; // end
 #while (Nr < End)  // loop
    object{ Element translate <1,0,0>
            rotate<0,0,-90+Nr*180/End>
            rotate<0,12*Nr*360/End,0>
          }
 #local Nr = Nr + 1;    // next Nr
 #end // ---------------  end of loop
 // end of spiral ---------------------

rotate<0,0,0>
translate<0,1,0>
} // end of union ---------------------
For a double spiral replace the upper spiral part by this:
 // double spiral --------------------
 #local Nr =  0;    // start
 #local End = 6000; // end
 #local Turns = 7;

 #while (Nr < End)  // loop
    object{ Element translate<1,0,0>
            rotate<0, 0,-90+Nr*180/End>
            rotate<0, Turns*Nr*360/End,0>
          }
    object{ Element translate<-1,0,0>
            rotate<0, 0,-90+Nr*180/End>
            rotate<0,-Turns*Nr*360/End,0>
          }
 #local Nr = Nr + 1;    // next Nr
 #end // ---------------  end of loop
 // end of double spiral --------------
........ :


Scene file for POV-Ray: SphericalSpiral_1.pov
or: SphericalSpiral_1.txt

Scene file for POV-Ray: SphericalSpiral_2.pov
or: SphericalSpiral_2.txt


top

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