// Persistence Of Vision raytracer version 3.0 sample file. // File: BlobLoop.POV // Vers: 3 // Desc: Shows off the while loop for creating complex blob objects. // Date: 10/1/95 // Auth: Eduard Schwan // Heavily modified by aardvarko@geocities.com. // BlobLoop4 #version 3.0 #include "colors.inc" global_settings { assumed_gamma 1.0 max_trace_level 7} #declare A = clock #include "metals.inc" camera { location <0, 10, -8> direction 1*z look_at <0, 0, 0> } light_source { <0, 30, 0> color White spotlight radius 5 falloff 20 tightness 10 point_at <0, 0, 0> } light_source { <10, 30, -30> color Blue spotlight radius 4 falloff 15 tightness 10 point_at <0, 2, 0> } light_source { <-10, 30, 30> color Green spotlight radius 4 falloff 15 tightness 10 point_at <0, 2, 0> } light_source { <10, 30, 30> color SlateBlue spotlight radius 4 falloff 15 tightness 10 point_at <0, 2, 0> } // ------------------------------------------------------------------ // Simple dark background for a simple scene background { color Blue } plane { y, -0.1 // texture { material_map { // png "d:\colored3.png" // map_type 0 //plan // texture {T0} //0: unused // texture {T2} //1 // texture {T3} //2 // texture {T4} //3 // texture {T5} //4 // texture {T6} //5 // texture {T7} //6 // texture {T8} //7 // texture {T1} //8 // } // rotate 90*x // scale 5 //} texture { pigment { color rgb <.1, .8, .8> } } } // ------------------------------------------------------------------ // Set up the loop variables: // the Counter variable will go from 0.0 to 1.0 in NumIterations loops. #declare NumIterations = A // leave these next calculations alone #declare Increment = 1.0/NumIterations #declare NumTwists = 360*2 // # of full twists #declare Height = 4 // total height of object // ------------------------------------------------------------------ // Here is the large loop-generated blob blob { threshold 0.1 // create a series of components, using a while-loop #declare Counter = 0.001 #while (Counter<=1.0) // put a rod across axis cylinder { <-5*(1-Counter), Counter*Height, 0>, // of one end < 5*(1-Counter), Counter*Height, 0>, // of other end Increment*10, // radius 2 // blob component strength // put down the texture AFTER the component is in place // so it lines up across them texture { // make the color change as we wind our way up the shape T_Silver_5E} finish { ambient 0 specular 0.6 reflection 1 roughness 0.01 } rotate Counter*NumTwists*y } // now add a ball on each end of the rod sphere { <-5*(1-Counter), Counter*Height, 0>, Increment*30, 2 rotate Counter*NumTwists*y // put down the texture AFTER the component is in place // so it lines up across them texture { // make the color change as we wind our way up the shape pigment {P_Chrome2} finish { ambient 0.2 specular 0.6 reflection 01 roughness 0.01 } } } sphere { < 5*(1-Counter), Counter*Height, 0>, Increment*30, 2 rotate Counter*NumTwists*y // put down the texture AFTER the component is in place // so it lines up across them texture { // make the color change as we wind our way up the shape pigment { P_Silver3} finish { ambient 0.2 specular 0.6 reflection 1 roughness .2 } } } // manually increment our counter inside the loop #declare Counter=Counter+Increment #end rotate -30*y // view from a better angle }