1// Persistence Of Vision raytracer version 3.5 sample file. 2// this scene demonstrates a possible use of the pigment_pattern pattern 3 4// first, we'll define a reasonably complex pigment, made of wrinkles 5// and leopard pigments mapped within a bozo pattern in another pigment. 6// 7// -w320 -h240 8// -w800 -h600 +a0.3 9 10#include "colors.inc" 11 12//the two basic pigments 13#declare Pig1 = pigment { 14 leopard 15 color_map { 16 [0 SteelBlue] 17 [1 Yellow] 18 } 19 sine_wave 20 scale .05 21} 22 23#declare Pig2 = pigment { 24 wrinkles 25 color_map { 26 [0.0 Orange] 27 [0.5 White] 28 [1.0 White] 29 } 30} 31 32//the complex pigment 33#declare Pig3 = pigment { 34 bozo 35 pigment_map { 36 [0 Pig1] 37 [1 Pig2] 38 } 39 triangle_wave 40 scale 1.5 41} 42 43//the first, greenish, sphere shows the complex pigment as is 44sphere {<0,4,0>,4 pigment {Pig3}} 45 46//the second, gray, sphere shows how the complex pigment becomes 47//a new pattern with values from 0 to 1 48sphere {<0,4,0>,4 49 pigment {pigment_pattern {Pig3}} 50 translate z*12 51 } 52 53//and the big torus shows the new pattern with an orange color_map, 54//and an added normal using the same pattern to create visible craters 55//on the surface, following the complex pattern. 56torus {7 2 57 pigment {pigment_pattern {Pig3} 58 color_map { 59 [0 OrangeRed*.2] 60 [1 OrangeRed*1.5] 61 } 62 } 63 normal {pigment_pattern {Pig3} .4} 64 finish {phong .8 phong_size 10} 65 translate y*2 66 } 67 68//some usual scene elements 69camera {location <10,20,10> look_at <0,2,4> angle 50} 70plane {y,0 pigment {rgb <.2,.4,.3>}} 71light_source {<20,30,40> White*1.2} 72light_source {<-20,30,-40> Wheat*.5 shadowless} 73