File: vturbulence.pov

package info (click to toggle)
povray 1%3A3.7.0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 147,232 kB
  • sloc: cpp: 845,011; ansic: 122,118; sh: 34,204; pascal: 6,420; asm: 3,355; ada: 1,681; makefile: 1,389; cs: 879; awk: 590; perl: 245; xml: 95
file content (125 lines) | stat: -rw-r--r-- 2,300 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// This work is licensed under the Creative Commons Attribution 3.0 Unported License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
// or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View,
// California, 94041, USA.

// Persistence Of Vision Ray Tracer Scene Description File
// File: vturbulence.pov
// Desc: vturbulence sample
// Date: June 2001
// Auth: Christoph Hormann

// -w320 -h240
// -w512 -h384 +a0.3

#version 3.6;

global_settings {
  assumed_gamma 1.0
}

//#declare Style=0;    // just the spheres
#declare Style=1;    // with connecting cylinders

camera {
  location    <20, 16, 25>
  right     x*image_width/image_height
  look_at     <0, 0, 0>
  angle       7
}

light_source {
  <3.2, 1.8, -0.6>*100000
  color rgb <1.5, 1.4, 1.1>
}

sphere {
  0,1
  texture {
    pigment {
      agate
      color_map {
        [0.0 color rgb <1.0, 0.6, 0.4> ]
        [1.0 color rgb <1.0, 0.8, 0.6> ]
      }
    }
    finish { ambient 1 diffuse 0 }
  }
  scale 1000
  no_shadow
  hollow on
}


#declare T_Sphere=
texture {
  pigment {
    gradient y
    color_map {
      [0 color rgb <1, 0, 0> ]
      [1 color rgb <1, 1, 0> ]
    }
    translate -0.5*y
  }
}

#declare T_Sphere2=
texture {
  pigment { color rgb <0.1, 0, 1> }
}

#declare T_Cyl=
texture {
  pigment { color rgb <1, 0.2, 0.3> }
}

#declare Spacing=0.12;
#declare Radius=0.03;

#declare PosX=-1.5;

union {
  #while (PosX < 1.5)

    #declare PosZ=-1.5;
    union {
      #while (PosZ < 1.5)

        #if (clock_on)
          #declare Turb=vturbulence(2, 0.5, 6, <PosX, 0, PosZ>)*clock*0.5;
        #else
          #declare Turb=vturbulence(2, 0.5, 6, <PosX, 0, PosZ>)*0.5;
        #end

        sphere {
          <PosX, 0, PosZ>+Turb,
          Radius
          texture { T_Sphere }
        }

        #if (Style=1)
          sphere {
            <PosX, 0, PosZ>,
            Radius
            texture { T_Sphere2 }
          }
          #if (vlength(Turb)>Radius)
            cylinder {
              <PosX, 0, PosZ>,
              <PosX, 0, PosZ>+Turb ,
              Radius*0.7
              texture { T_Cyl }
            } 
          #end  
        #end

        #declare PosZ=PosZ+Spacing;

      #end
    }

    #declare PosX=PosX+Spacing;
  #end
}