#include "colors.inc" #include "shapes.inc" #include "woods.inc" #include "textures.inc" //カメラの設定 camera { location <3.6, 5, -7> look_at <-0.8, 0.8, 0> angle 30 right x*image_width/image_height } //ライトの設定 light_source { <100, 30, -100> color rgb 1.2 } light_source { <-100, 30, -100> color rgb 0.2 } light_source { <-50, 30, 100> color rgb 0.1 } //時計全体をunionでまとめる //まとめておくと,後から移動などがしやすくなる #declare tokei_zentai = union { //短針と長針も後で回転などをしやすくするためにunionでまとめている //短針。円柱と立方体を変形した上で組み合わせて作成。 #declare tanshin = union { object { cylinder { <0, 0, 0.007>, <0, 0, -0.007>, 0.05 } pigment { White*0.3 } translate <0, 0, -0.02> } object { box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5> } pigment { White*0.3 } scale <0.04, 0.6, 0.014> translate <0, 0.3, -0.02> } } //長針。円柱と立方体を変形した上で組み合わせて作成。 #declare choushin = union { object { cylinder { <0, 0, 0.007>, <0, 0, -0.007>, 0.05 } pigment { White*0.3 } translate <0, 0, -0.04> } object { box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5> } pigment { White*0.3 } scale <0.04, 0.8, 0.014> translate <0, 0.4, -0.04> } } //短針と長針を回転,移動 object { tanshin rotate <0, 0, -306> translate <0, 0, -0.51>} object { choushin rotate <0, 0, -60> translate <0, 0, -0.51>} //文字盤と目盛り #declare Mojiban = union { //文字盤 object { disc { <0, 0, 0>, z, 0.9, 0 } texture { pigment { image_map { jpeg "mojiban.jpg" once } } finish { ambient 0.7 }//そのままでは暗いのでambientで明るくしている translate <-0.5, -0.5, 0> scale <1.8, 1.8, 1> } } #declare MyObj = union{ //5分ごとの目盛りの下準備 #declare MyCounter = 0; #while ( MyCounter < 180 ) object { cylinder { <0, -0.85, 0>, <0, 0.85, 0>, 0.015 } texture { Bronze_Metal//pigment { Red } } rotate <0, 0, MyCounter> } #declare MyCounter = MyCounter + 30; #end } //1分ごとの目盛りの下準備 #declare MyObj2 = union { #declare MyCounter2 = 0; #while ( MyCounter2 < 180 ) object { cylinder { <0, -0.85, 0>, <0, 0.85, 0>, 0.007 } texture { Bronze_Metal//pigment { Blue } } rotate <0, 0, MyCounter2> } #declare MyCounter2 = MyCounter2 + 6; #end } //円柱を使ってくりぬく difference { object { MyObj } object { cylinder { <0, 0, -1>, <0, 0, 1>, 0.65 } texture { Bronze_Metal } } } difference { object { MyObj2 } object { cylinder { <0, 0, -1>, <0, 0, 1>, 0.72 } texture { Bronze_Metal } } } //短針・長針の軸。球を変形して作成。 object { sphere { <0, 0, 0>, 1 } texture { pigment { White } } scale <0.03, 0.03, 0.1> } } //文字盤を移動 object { Mojiban translate <0, 0, -0.5>} //文字盤の上の透明な板 object { box { <-1, -1, -1>, <1, 1, 1> } texture { pigment { White*0.9 filter 0.95} finish { specular 0.4 reflection { 0.2 }//床が少しだけ映り込むように設定。 conserve_energy//このオプションをつけないと,不必要に明るくなってしまう。 } } scale <0.9, 0.9, 0.005> translate <0, 0, -0.62> } //時計の外形。ラウンドボックスから円柱をくりぬく difference { object { Round_Box_Union(<-1,-1,-1>, <1,1,1>, .075) texture { pigment {color Red} finish { phong 0.6 phong_size 150 reflection 0.1 specular 0.2 conserve_energy } } scale <1, 1, 0.7> } object { cylinder {<0, -1, 0>, <0, 1, 0>, 1} texture { Copper_Metal//pigment {color rgb 1} } scale <0.8, 1, 0.8> rotate <90, 0, 0> translate <0, 0, -1.4> } } } //時計を移動する object { tokei_zentai translate <0, 1, 0> } //床の指定 object { plane { y, -0.0 } texture { T_Wood19 scale 2 } }