1//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo// 2// // 3// Windows users: to start rendering this image, press Alt+G or the 'Run' // 4// button on the toobar. // 5// // 6// Experienced windows users: try right-clicking on the line below ... // 7// // 8// +w320 +h240 9// +w800 +h600 +a0.3 +am2 10// // 11// See the docs for full explanations of new features such as the above. // 12// // 13//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo// 14 15// Persistence Of Vision raytracer version 3.5 sample file. 16// Copyright 2001 Fabien Mosen 17 18#include "colors.inc" 19#include "functions.inc" 20#include "logo.inc" 21 22global_settings {max_trace_level 5} 23 24camera {location <20,40,28> direction 2*z look_at <0,2,0>} 25 26light_source {<-140,200,300> rgb <1.0, 1.0, 0.95>*1.5} 27light_source {<140,200,-300> rgb <0.9, 0.9, 1.00>*0.8 shadowless} 28 29#declare r1 = seed(0); 30 31//----------------------- THE TABLE 32#declare Pig_1 = 33pigment { 34 gradient z 35 color_map { 36 [0.00, rgb <0.01, 0.59, 0.81>] 37 [0.70, rgb <0.01, 0.59, 0.81>] 38 [0.70, rgb <0.98, 0.98, 0.87>] 39 [1.00, rgb <0.98, 0.98, 0.87>] 40 } 41 frequency 4 42} 43 44#declare Pig_2 = 45pigment { 46 bozo 47 color_map { 48 [0.00, rgb <0.35, 0.58, 0.88>*1.0] 49 [0.25, rgb <0.35, 0.58, 0.88>*1.1] 50 [0.50, rgb <0.35, 0.58, 0.88>*0.9] 51 [0.75, rgb <0.35, 0.58, 0.88>*1.0] 52 [1.00, rgb <0.35, 0.58, 0.88>*0.8] 53 } 54 scale 0.1 55} 56 57#declare Nappe = 58cylinder {0,y*-1,50 59 texture { 60 pigment { 61 gradient x 62 pigment_map { 63 [0.0, Pig_1] 64 [0.5, Pig_1] 65 [0.5, Pig_2] 66 [1.0, Pig_2] 67 } 68 warp {turbulence .05 octaves 2} 69 } 70 normal {quilted 0.6 scale 0.025 warp {turbulence 0.05 octaves 2}} 71 scale 5 72 translate 10 73 } 74} 75 76object {Nappe} 77 78//----------------------- BISCUITS 79#declare Tex_Biscuit = 80texture { 81 pigment {color rgb <0.98, 0.83, 0.58>} 82 normal {dents 1.2 scale 0.01} 83 finish {phong 0 brilliance 0.7} 84} 85 86#declare Base_Biscuit = 87union { 88 blob { 89 threshold 0.7 90 #declare I = 0; 91 #while (I < 359) 92 sphere {<4,0,0>, 1+rand(r1)*0.1, 1 rotate y*I} 93 #declare I = I+(360/28); 94 #end 95 } 96 cylinder {<0,0,0>, <0,0.5,0>, 4} 97 texture {Tex_Biscuit} 98} 99 100#declare Chocolate = 101union { 102 difference { 103 cone {<0,0,0>, 4.2, <0,0.4,0>, 4} 104 cone {<0,0.1,0>, 3.6, <0,0.401,0>, 3.75} 105 } 106 torus { 107 3.55, 0.1 108 translate y*0.2 109 clipped_by {torus {3.55+0.1, 0.1 translate y*0.1}} 110 } 111 union { 112 #declare I = -4; 113 #while (I < 4) 114 cylinder {<-4,0.1,I>,<4,0.1,I>, 0.05} 115 #declare I = I+0.5; 116 #end 117 clipped_by {cone {<0,0,0>, 4.2, <0,0.4,0>, 4}} 118 } 119 torus {3.96, 0.04 translate y*0.4} 120 torus {3.79, 0.04 translate y*0.4} 121} 122 123#declare LogoFun = 124object{Povray_Logo_Prism rotate x*90 scale 2.2 translate -0.3*z} 125 126#declare ProjLogo = 127blob { 128 threshold 0.6 129 #declare I = 0; 130 #while (I < 1) 131 #declare Pos = <-2+rand(r1)*4, 0, -2+rand(r1)*4>; 132 #if (inside(LogoFun,Pos)) 133 sphere {Pos, 0.08, 1} 134 #end 135 #declare I = I+0.0002; 136 #end 137} 138 139#declare Black_Chocolate = 140texture { 141 pigment {color rgb <0.24, 0.10, 0.03>} 142 normal {wrinkles 0.2} 143 finish {specular 0.3} 144 } 145#declare Milk_Chocolate = 146texture { 147 pigment {color rgb <0.48, 0.26, 0.13>} 148 normal {wrinkles 0.2} 149 finish {specular 0.2} 150} 151#declare White_Chocolate = 152texture { 153 pigment {color rgb <0.96, 0.95, 0.75>} 154 normal {wrinkles 0.2} 155 finish {ambient 0.3 specular 0.01} 156} 157 158#declare Icing = texture { 159 pigment {rgbf <0.95, 0.95, 1.00, 0.1>*1.2} 160 normal {bumps 0.1} 161} 162 163#declare Biscuit_1 = 164union { 165 object {Base_Biscuit} 166 object {Chocolate translate y*0.5 texture {Black_Chocolate}} 167 disc { 168 <0,0.101,0>, y, 3.6 169 translate y*0.5 170 texture {Black_Chocolate} normal {bumps 0.3 scale 0.05} 171 } 172 object {ProjLogo scale 1.5 rotate y*-90 translate <-0.4,0.6,0.5> texture {Icing}} 173 translate y*0.5 174} 175#declare Biscuit_2 = 176union { 177 object {Base_Biscuit} 178 object {Chocolate translate y*0.5 texture {Milk_Chocolate}} 179 disc { 180 <0,0.101,0>, y, 3.6 181 translate y*0.5 182 texture {Milk_Chocolate} normal {bumps 0.3 scale 0.05} 183 } 184 object {ProjLogo scale 1.5 rotate y*-90 translate <-0.4,0.6,0.5> texture {White_Chocolate}} 185 translate y*0.5 186} 187#declare Biscuit_3 = 188union { 189 object {Base_Biscuit} 190 object {Chocolate translate y*0.5 texture {White_Chocolate}} 191 disc { 192 <0,0.101,0>, y, 3.6 193 translate y*0.5 194 texture {White_Chocolate} normal {bumps 0.3 scale 0.05} 195 } 196 object {ProjLogo scale 1.5 rotate y*-90 translate <-0.4,0.6,0.5> texture {Milk_Chocolate}} 197 translate y*0.5 198} 199 200object {Biscuit_2 rotate y*-80 translate <-3.5,0,2>} 201object {Biscuit_1 rotate y*-120 translate <3.5,0,-4>} 202object {Biscuit_3 rotate x*-4 translate <8.5,0.9,0>} 203 204#macro SevenBiscuits (Bisc,Num) 205 union { 206 #declare I = 0; 207 #while (I < Num) 208 object {Bisc translate x*9 rotate y*60*I} 209 #declare I = I+1; 210 #end 211 object {Bisc} 212 } 213#end 214 215//----------------------- CRUMBS 216#declare Fun_Sphere = function {x*x + y*y +z*z} 217 218#declare Crumb = 219isosurface { 220 function {Fun_Sphere(x,y,z) + f_noise3d(x*2,y*2,z*2)*1} 221 threshold 1 222 max_gradient 3.9 223 //max_gradient 15 224 accuracy 0.01 225 contained_by {box {-1,1}} 226 scale 0.5 227} 228 229#declare r1 = seed(0); 230 231#declare I = 0; 232#while (I < 1) 233 object { 234 Crumb 235 rotate rand(r1)*360 236 scale 0.2+rand(r1)*0.3 237 translate <rand(r1)*10,0,rand(r1)*10> 238 texture {Tex_Biscuit} 239 } 240 object { 241 Crumb 242 rotate rand(r1)*360 243 scale 0.1+rand(r1)*0.15 244 translate <rand(r1)*10,0,rand(r1)*10> 245 texture {Tex_Biscuit} 246 } 247 #declare I = I+0.03; 248#end 249 250//----------------------- METAL BOX 251#declare Pig3 = 252pigment { 253 gradient y 254 color_map { 255 [0, rgb <0.1, 0.5, 0.7>] 256 [1, rgb <0.7, 0.6, 0.4>] 257 } 258 scale 0.5 259} 260 261#declare Pig4 = 262pigment { 263 crackle 264 color_map { 265 [0, rgb <1.0, 0.5, 0.6>] 266 [1, rgb <0.0, 0.0, 0.0>] 267 } 268 scale 0.2 269} 270 271#declare MetalBoxPig = 272pigment { 273 radial frequency 60 274 pigment_map { 275 [0.0, Pig3] 276 [0.5, Pig3] 277 [0.5, Pig4] 278 [1.0, Pig4] 279 } 280} 281 282#declare BiscuitBox = 283union { 284 difference { 285 cylinder {<0,0,0>, <0,5,0>, 14} 286 cylinder {<0,0.1,0>, <0,5.1,0>, 13.9} 287 } 288 torus {14, 0.1 translate y*5} 289 torus {14, 0.1 translate y*0.1} 290 torus {14, 0.1 scale <1,2,1> translate y*4} 291 cylinder { 292 <0,0.3,0>,<0,3.5,0>, 14.01 open 293 pigment {MetalBoxPig} 294 finish {phong 0.8 reflection {0.01, 0.15}} 295 } 296 pigment {Gray60} 297 finish {phong 0.8 metallic reflection {0.5, 0.7}} 298} 299 300union { 301 object {BiscuitBox} 302 object {SevenBiscuits (Biscuit_1,6)} 303 object {SevenBiscuits (Biscuit_3,6) rotate y*30 translate y*1} 304 object {SevenBiscuits (Biscuit_2,5) rotate y*0 translate y*2} 305 rotate y*-75 translate <-18,0,-12> 306} 307 308//-----------------------CUP OF TEA 309#declare TeaCup = 310union { 311 difference { 312 cylinder {<0,1.2,0>, <0,6,0>, 4.2} 313 cylinder {<0,1,0>, <0,6.2,0>, 3.8} 314 } 315 316 difference { 317 cylinder {<0,0.2,0>, <0,2.5,0>, 4} 318 torus {2.8, 1 translate y*2.5} 319 torus {4, 1 translate y*0} 320 cylinder {<0,1.5,0>, <0,2.6,0>, 2.8} 321 } 322 323 difference { 324 #declare LiquidLevel = 5; 325 cylinder {<0,1.4,0>, <0,LiquidLevel,0>, 4} 326 torus {3.6, 0.2 translate y*LiquidLevel} 327 cylinder {<0,LiquidLevel-0.2,0>,<0,LiquidLevel+0.3,0>,3.6} 328 pigment {Orange*0.8 filter 0.6} 329 finish {phong 0.7 reflection 0.15} 330 normal {bumps 0.05 scale 1} 331 } 332 333 torus {4.0, 0.2 translate y*6.0} 334 torus {4.0, 0.2 translate y*1.2} 335 torus {2.8, 0.2 translate y*0.2} 336 337 union { 338 difference { 339 cylinder {<0.2,0,0>,<-0.2,0,0>,0.5} 340 torus {0.5, 0.2 rotate z*90 translate x*0.2} 341 translate y*1.25 342 } 343 difference { 344 cylinder {<0.2,0,0>,<-0.2,0,0>,0.5} 345 torus {0.5, 0.2 rotate z*90 translate x*0.2} 346 translate y*-1.25 347 } 348 torus {1.25, 0.3 rotate x*90 clipped_by {plane {x,0 inverse}} translate x*0.8} 349 cylinder {<0,-1.25,0>,<0.8,-1.25,0>,0.3} 350 cylinder {<0,1.25,0>,<0.8,1.25,0>,0.3} 351 scale <1,1,1.5> translate <4.2,4,0> rotate y*-90 352 } 353 354 pigment {White} 355 normal {bumps 0.05 scale 3} 356 finish {phong 0.8 reflection 0.1} 357} 358 359object {TeaCup rotate y*50 translate <4,0,-14>} 360