// Test for Recursive Object macro. camera { location <1.5, 1, -3> look_at <0, 1, 0> } light_source { // Light1 <-986.689, 1003.370, -1011.881> color rgb <1.000, 1.000, 1.000> } #declare TextA = texture { pigment { colour rgb <0.9,0.7,0> } finish { ambient 0.3 diffuse 0.65 phong 0.3 phong_size 20 } } #declare TextB = texture { pigment { colour rgb <0.3,0.1,0.7> } finish { ambient 0.3 diffuse 0.65 phong 0.3 phong_size 20 } } #declare TextC = texture { pigment { colour rgb <0.9,0.1,0.16> } finish { ambient 0.3 diffuse 0.65 phong 0.3 phong_size 20 } } #include "recursiv.inc" #declare BaseObject = box { <-1,0,-1>, <1,2,1> } // Simple cube ROAddCopy(<0,0,0>,<1,0.25,1>,<0,0,0>,TextA,1) // Base ROAddCopy(<-0.55,0.5,-0.55>,<0.4,0.6,0.4>,<0,0,0>,TextB,1) // Centre Column ROAddCopy(<0.55,0.5,-0.55>,<0.4,0.6,0.4>,<0,0,0>,TextB,1) // Centre Column ROAddCopy(<-0.55,0.5,0.55>,<0.4,0.6,0.4>,<0,0,0>,TextB,1) // Centre Column ROAddCopy(<0.55,0.5,0.55>,<0.4,0.6,0.4>,<0,0,0>,TextB,1) // Centre Column ROAddCopy(<0,1.7,0>,<0.975,0.15,0.975>,<0,0,0>,TextC,1) // Roof // Note that the 6 copies almost fill the base object. This makes a fairly dense object. // To see how the system works, start with the second parameter to RODraw = 0. // Then increase it 1 at a time and render, and watch the recursion! // At level = 6, you will get around 1300 cubes, 7 -> 7776, 8 -> 46656, ..... RODraw(BaseObject,6)