// ANIMATION 1000 //specifies the animation total time as 1 second #include "AutoClck.mcr" // one division of clock #declare clock_div_1 = union { box { <-2, -1, -1> <2, 1, 1> scale <0.1, 0.1, 0.1> translate <4, -0.2, 0> } } // 4 divisions of a clock #declare clock_div_4 = union { object { clock_div_1 rotate <0, 0, 0> } object { clock_div_1 rotate <0, 0, 90> } object { clock_div_1 rotate <0, 0, 180> } object { clock_div_1 rotate <0, 0, 270> } } //----------- declare a clock with divisions // note that there would be no output until we use an object{} statement #declare myclock = union { union { object { clock_div_4 rotate <0, 0, -2> } object { clock_div_4 rotate <0, 0, 2> } object { clock_div_4 rotate <0, 0, 30> } object { clock_div_4 rotate <0, 0, 60> } // color: will be applied to sub objects // because no color has already been specified for them pigment {color rgb <0.7, 1, 0>} // green } // plate cylinder { <0, 0, -1>, <0, 0, -0.3>, 4.5 pigment {color rgb <0.9, 0.6, 0.8>} // yellow } // ---------- Center sphere { <0, 0, 0> 0.2 pigment {color rgb <1, 1, 1>} // white } } //----------- Hand #declare clock_hand = union { cone { <0, 1, 0>, 0.05, <0, 0, 0>, 0.3 pigment {color rgb <1, 0.5, 0>} // brown translate <0, 2, 0> } cylinder { <0, 2, 0>, <0, -1, 0>, 0.1 pigment {color rgb <1, 1, 0>} // yellow } } //----------- Hour Hand #declare clock_hour = object { clock_hand scale <0.8, 0.7, 1> } //----------- Minute Hand #declare clock_minute = object { clock_hand scale <0.5, 1, 0.5> rotate From (0, <0, 0, 0>) Using ( "", 1, 1, "") To (1, <0, 0, -12>) } //----------- Second #declare clock_second = object { clock_hand scale <0.2, 1.2, 0.2> rotate From (0, <0, 0, 0>) Using ( "", 1, 1, "") To (1, <0, 0, -720>) }