###### Descriptions and Examples for the POV-Ray Raytracerby Friedrich A. Lohmüller About Loops with POV-Ray
Italiano
Français
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

## Spherical Spirals 2

Circular transformations on the surface of a sphere:
 ```#declare Element = sphere{ <0,0,0>,0.05 texture{ pigment{ color rgb<0.8,0.4,0>} finish { phong 1 reflection{0.3 metallic 0.5}} } // end texture } // end sphere ----------------------- #local Drill = 0.45; #local Stripes = 8; union{ //------------------------------ // spirals --------------------------- #local NrB = 0; // start #local EndB = 2000; // end #while (NrB < EndB) #local Nr = 0; // start #local End = Stripes; // end #while (Nr < End) // loop object{ Element // * add scale here! translate<1,0,0> rotate<0, 0,-90+NrB *180/EndB> rotate<0,Drill*NrB* 360/EndB,0> rotate<0,Nr*360/End,0> } //---------------------- #local Nr = Nr + 1; // next Nr #end // --------------- end of loop #local NrB = NrB + 1; // next Nr #end // --------------- end of loop // end of spirals --------------------- rotate<0,0,0> translate<0,1,0> } // end of union ---------------------```
Scaling the spiral elements in z direction:
 ``` scale 1+<0,0,4> *cos( radians( -90 +NrB * 180/EndB ) ) ```

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

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

If we replace the element by:
 ```#declare Element = union{ sphere{ <0,0,0>,0.05 } sphere{ <0,0,0>,0.05 translate<-0.04,0,0> texture{ pigment{ color rgb<1,1,1>*0.95} normal { bumps 0.75 scale 0.01} finish { phong 0.7 } } // end of texture } } // end union -------------------------- ```
and finally add a global texture like this:
 ``` texture{ pigment{ color rgb<1,0.4,0>} normal { bumps 0.75 scale 0.02} finish { phong 1 reflection{ 0.1 metallic 0.5}} }```
we will get the following image (right):

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

 Overview | For + While | Linear | Circular | Moebius | Screws+Spirals | Twisted Spirals | Snails | Spherical 1 | Spherical 2 | Fibonacci |
top

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