トップページ>3Dグラフィックス POV-Ray>谷津遊園の大観覧車 |
谷津遊園の大観覧車 |
谷津遊園地の大観覧車。階段等は後ほど作ります。
部品を作ってwhileループで同じ物を円形に配置します。
参考にしたのは谷津遊園で撮影した寅さんのこの映画のパンフレットの写真と
DVDのなかの観覧車が出てくる場面。
以下の3枚のハイトフィールド用png画像をシーンファイルと同じ場所に保存し
Runをクリックするとレンダリングされます。
//ooooooooooooooooooooooooooooooooo //京成谷津遊園大観覧車ver20081217 //POV-Ray for Windows v3.6 // +W3200 +H2400 +FN +A0.3 //ooooooooooooooooooooooooooooooooo #include "colors.inc" #include "textures.inc" //ラジオシティでレンダリングをする場合はコメントアウトをはずせば //きれいな画像ができますが、時間がかかります。 /* global_settings{ radiosity{ pretrace_start 0.08 pretrace_end 0.04 count 35 nearest_count 5 error_bound 1.8 recursion_limit 3 low_error_factor 0.5 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 } } */ camera{ //斜め前から location<50,-10,13> look_at<0,0,0> angle 50 //回転軸のアップ //location<0,0,10> //look_at<0,0,0> //angle 50 //黄色いゴンドラのアップ //location<10,10,20> //look_at<0,5.5,15> //angle 30 //斜め上から //location<10,30,30> //look_at<-1,0,0> //angle 30 } light_source{<50,50,50>White*2} light_source{<50, 0, 0>White} #declare BodyColor=White; //回転軸部分 cylinder{<.05,0,0><-0.05,0,0>1.5 pigment{BodyColor}translate 3.0*x} cylinder{<.05,0,0><-0.05,0,0>1.5 pigment{BodyColor}translate -3.0*x} cylinder{<.05,0,0><-0.05,0,0>1.4 pigment{BodyColor}translate 2.8*x} cylinder{<.05,0,0><-0.05,0,0>1.4 pigment{BodyColor}translate -2.8*x} cylinder{<.05,0,0><-0.05,0,0>1.2 pigment{BodyColor}translate 2.0*x} cylinder{<.05,0,0><-0.05,0,0>1.2 pigment{BodyColor}translate -2.0*x} cylinder{<.05,0,0><-0.05,0,0>1.2 pigment{BodyColor}translate 1.0*x} cylinder{<.05,0,0><-0.05,0,0>1.2 pigment{BodyColor}translate -1.0*x} cylinder{<3,0,0><-3,0,0>1.0 pigment{BodyColor}} cylinder{<4,0,0><-4,0,0>0.3 pigment{BodyColor}} box{<1.5,-0.75,-0.75><-0.75,.75,.75>translate 4.5*x pigment{BodyColor}} box{<.75,-0.75,-0.75><-0.75,.75,.75>translate -4.5*x pigment{BodyColor}} #declare Body_D=prism{linear_sweep linear_spline -.04,.04,4,<0,0><0,-.4><.4,0><0,0>} #declare i=0; #while(i<24) object{Body_D scale<.75,.5,.75>rotate 90*x translate<-2.8,1, 0>rotate i*15*x pigment{BodyColor}} object{Body_D scale<.75,.5,.75>rotate 90*y translate< 2.8,0,-1>rotate i*15*x pigment{BodyColor}} #declare i=i+1; #end //回転軸部分終わり //支柱 #declare post=object{ cylinder{<0,0,0><0,-30,0>.2 pigment{Copper}}} object{post rotate 17.5*x translate 4.5*x} object{post rotate -17.5*x translate 4.5*x} object{post rotate 17.5*x translate -4.5*x} object{post rotate -17.5*x translate -4.5*x} object{post rotate 17.5*z translate 4.5*x} object{post rotate -17.5*z translate -4.5*x} #declare ashiba=object{ union{ difference{ union{ cylinder{< .1,0,-.11>< .1,0,.1>.01} cylinder{<-.1,0,-.11><-.1,0,.1>.01} } box{<.2,-.03,0><0,.03,.2>rotate 135*y} } difference{ cylinder{<.11,0,-.1><-.11,0,-.1>.01} box{<.2,-.03,0><0,.03,.2>rotate 45*y} box{<.2,-.03,0><0,.03,.2>rotate -135*y} } } pigment{BodyColor} translate -.25*z } #declare ashiba2=union{ #declare i=1; #while(i<=60) object{ashiba translate -.5*i*y } #declare i=i+1; #end } object{ashiba2 rotate 17.5*x translate 4.5*x} object{ashiba2 rotate 180*y rotate -17.5*x translate 4.5*x} object{ashiba2 rotate 17.5*x translate -4.5*x} object{ashiba2 rotate 180*y rotate -17.5*x translate -4.5*x} //支柱終わり //乗場 box{<4.2,-19,-6><-4.2,-18.8,6>pigment{BodyColor}} //六角ボルト #declare bolt=object{ prism{linear_sweep linear_spline 0,.02,7, <.05,0><.05*.5,.05*.866><-.05*.5,.05*.866> <-.05,0><-.05*.5,-.05*.866><.05*.5,-.05*.866> <.05,0> pigment{BodyColor} } } #declare Body_A=union{ prism{linear_sweep linear_spline 0,.05,7, <-.25,0><-.25,1.5><-.05,3.5> <.05,3.5><.25,1.5><.25,0><-.25,0> } cylinder{<0,0,0><0,.05,0>.25} object{bolt translate < .175,.05, .075>} object{bolt translate <-.175,.05, .075>} object{bolt translate < .175,.05,1.425>} object{bolt translate <-.175,.05,1.425>} } #declare Body_B=union{ box{<.05,-13.5*tan(pi/24),13.5><0,13.5*tan(pi/24),13.65>} box{<.05,-15*tan(pi/24),14.85><0,15*tan(pi/24),15>} box{<.05,-.0375,13.5><0,.0375,15>} box{<0,0,0><-.05,2.15,.15>rotate 40.2*x translate<0,-12.5*tan(pi/24),13.5>} box{<0,0,0><-.05,2.15,.15>rotate -40.2*x translate<0,0,14.85>} } #declare Body_E=object{ union{ box{<.05,-.4,-.25><0,.4,0>} box{<.05,-.4,0><-.25,.4,.05>} object{bolt rotate -90*z translate<.05, .25,-.15>} object{bolt rotate -90*z translate<.05,-.25,-.15>} } translate<-.05,0,-.05> } #declare Body=union{ #declare i=0; #while(i<24) union{ object{Body_A rotate -90*z rotate -7.5*x translate<.05,1.78,13.5>} object{Body_B} object{Body_E translate<.05,0,15>} pigment{BodyColor} rotate 15*i*x } #declare i=i+1; #end } #declare widthA=1; object{Body translate 1*x} object{Body translate 1*x rotate 180*y} //gondola start #macro DrawGondola(X,Y,Z,GondolaColor) #declare gondola_outer=merge{ cylinder{<0,0,0><0,2,0>1} torus{.8,.2 translate<0,2,0>} cylinder{<0,1.8,0><0,2.2,0>.8} difference{ cone{<0,.00001,0>1<0,-3,0>0}//少し重ねる box{<1,-3,1><-1,-.75,-1>} } pigment{NewTan} } #declare wf_width=.05; #declare windowframe1=intersection{ cylinder{<0,0,0><0,2,0>1.01} object{box{<.8+wf_width,.6-wf_width,-1.1><-.8-wf_width,1.9+wf_width,1.1>}} pigment{BodyColor} } #declare windowframe2=intersection{ cylinder{<0,0,0><0,2,0>1.01} object{box{<1.1,.7-wf_width,-.3-wf_width><0,1.7+wf_width,.3+wf_width>}} pigment{BodyColor} } #declare windowframe3=intersection{ cylinder{<0,0,0><0,2,0>1.01} object{box{<0,.6-wf_width,-.4-wf_width><-1.1,1.9+wf_width,.4+wf_width>}} pigment{BodyColor} } #declare doorframe=difference{ intersection{ object{gondola_outer scale 1.01} box{<1.1,-.7,-.45><0,1.95,.45>} } box{<1.1,-.68, -.43><0,1.93,.43>} pigment{BodyColor} } #declare Lock=union{ box{<.5,-1,-3><-2,1,-2>} box{<.5,-1,3><-2,1,2>} box{<.2,-.5,-4.5><-.2,.5,2>} sphere{<.7,0,-4>.5} texture{Silver1} scale .03 rotate y*25 } #declare arm=union{ box{<.8,2.2,-.05><.7,2.7,.05>} cylinder{<.8,2.7,0><.7,2.7,0>.15} pigment{BodyColor} } #declare gondola_outer2=union{ object{gondola_outer pigment{GondolaColor}} windowframe1 windowframe2 windowframe3 doorframe object{arm} object{arm translate -1.5*x} } #declare gondola_inner=object{ gondola_outer pigment{NewTan}scale .95 } union{ difference{ object{gondola_outer2} object{gondola_inner} box{<.82,.6,-1.1><-.82,1.9,1.1>pigment{NewTan}} box{<1.1,0.7,-0.3><0,1.7,.3>pigment{NewTan}} box{<0,.6,-0.4><-1.1,1.9,.4>pigment{NewTan}} //cylinder{<0,-0.01,0><0,0.01,0>.95 pigment{NewTan}} } //窓ガラス difference{ cylinder{<0,0,0><0,2,0>1 material{M_Glass} interior{ior .98 } finish{phong 1 reflection .1} } cylinder{<0,0,0><0,2,0>.999 material{M_Glass} interior{ior .98 } finish{phong 1 reflection .1} } } //手すり torus{.925,.025 texture{Silver1}translate<0,1,0>} cylinder{<0,.5,.925><0,1,.925>.02 texture{Silver1}} cylinder{<0,.5,-.925><0,1,-.925>.02 texture{Silver1}} //座席 intersection{ object{gondola_outer pigment{Brown}} box{<.9,-.7,-.4><-.9,0.1,-.95>pigment{Brown}} } intersection{ object{gondola_outer pigment{Brown}} box{<.9,-.7,.4><-.9,.1,.95>pigment{Brown}} } object{Lock translate<.92,.45,-.45>} scale .5 translate<X,Y,Z> } #end //gondola end #declare Body_C=difference{ box{<0,-.05,0><.6,.05,.6>} cylinder{<.6,-.1,.6><.6,.1,.6>.6} } #declare i=1; #declare j=0; #while(i<=48) #if(mod(i,2)=1)//iが奇数の時 union{ cylinder{<widthA+.15,0,0><-widthA-.15,0,0>.04 translate<0,17*sin(i*pi/24),17*cos(i*pi/24)>} box{<widthA,-.075,14.97><-widthA,.075,15.12>rotate i*7.5*x} box{<widthA,-.075,13.55><-widthA,.075,13.7 >rotate i*7.5*x} object{Body_C translate<-1.05,0,15.12>rotate i*7.5*x} object{Body_C rotate -90*y translate<1.05,0,15.12>rotate i*7.5*x} object{Body_C translate<-1.05,0,13.7>rotate i*7.5*x} object{Body_C rotate -90*y translate<1.05,0,13.7 >rotate i*7.5*x} object{Body_D translate<-1.05,0,14.97>rotate i*7.5*x} object{Body_D rotate 90*y translate<1.05,0,14.97>rotate i*7.5*x} pigment{BodyColor} } //7.5deg=pi/24rad #switch(j) #case(0)DrawGondola(0,17*sin(i*pi/24)-2.7*.5,17*cos(i*pi/24),Blue)#break #case(1)DrawGondola(0,17*sin(i*pi/24)-2.7*.5,17*cos(i*pi/24),Yellow)#break #case(2)DrawGondola(0,17*sin(i*pi/24)-2.7*.5,17*cos(i*pi/24),Blue)#break #case(3)DrawGondola(0,17*sin(i*pi/24)-2.7*.5,17*cos(i*pi/24),Orange)#break #case(4)DrawGondola(0,17*sin(i*pi/24)-2.7*.5,17*cos(i*pi/24),ForestGreen)#break #case(5)DrawGondola(0,17*sin(i*pi/24)-2.7*.5,17*cos(i*pi/24),Red)//#breakはなし #declare j=-1; #end #declare j=j+1; #declare i=i+1; #else union{ //object{Body_E translate<1.05,0,15>rotate i*7.5*x} //object{Body_E rotate -90*y translate<-1.05,0,15>rotate i*7.5*x} box{<widthA,-.0375,14.95><-widthA,.0375,15>rotate i*7.5*x} box{<widthA,-.0375,13.5 ><-widthA,.0375,13.575>rotate i*7.5*x} pigment{BodyColor} } #declare i=i+1; #end #end //スポーク #declare i=0; #while(i<24) cylinder{< 1,13.52*sin(radians(i*15+8.0)),13.52*cos(radians(i*15+8.0))><2.8+.03,1.4*sin(radians(i*15+30)),1.4*cos(radians(i*15+30))>.02 pigment{BodyColor}} cylinder{< 1,13.52*sin(radians(i*15+7.0)),13.52*cos(radians(i*15+7.0))><2.8-.03,1.4*sin(radians(i*15-15)),1.4*cos(radians(i*15-15))>.02 pigment{BodyColor}} cylinder{< 1,13.52*sin(radians(i*15+7.5)),13.52*cos(radians(i*15+7.5))><-2.0,1.2*sin(radians(i*15+7.5)),1.2*cos(radians(i*15+7.5))>.02 pigment{BodyColor}} cylinder{<-1,13.52*sin(radians(i*15+8.0)),13.52*cos(radians(i*15+8.0))><-2.8-.03,1.4*sin(radians(i*15+30)),1.4*cos(radians(i*15+30))>.02 pigment{BodyColor}} cylinder{<-1,13.52*sin(radians(i*15+7.0)),13.52*cos(radians(i*15+7.0))><-2.8+.03,1.4*sin(radians(i*15-15)),1.4*cos(radians(i*15-15))>.02 pigment{BodyColor}} cylinder{<-1,13.52*sin(radians(i*15+7.5)),13.52*cos(radians(i*15+7.5))><2.0,1.2*sin(radians(i*15+7.5)),1.2*cos(radians(i*15+7.5))>.02 pigment{BodyColor}} //スポークを留めている金具 cylinder{< 1.15,13.52*sin(radians(i*15+8.0)),13.52*cos(radians(i*15+8.0))>< .95,13.52*sin(radians(i*15+8.0)),13.52*cos(radians(i*15+8.0))>.04 pigment{BodyColor}} cylinder{< 1.15,13.52*sin(radians(i*15+7.0)),13.52*cos(radians(i*15+7.0))>< .95,13.52*sin(radians(i*15+7.0)),13.52*cos(radians(i*15+7.0))>.04 pigment{BodyColor}} cylinder{< 1.15,13.52*sin(radians(i*15+7.5)),13.52*cos(radians(i*15+7.5))>< .95,13.52*sin(radians(i*15+7.5)),13.52*cos(radians(i*15+7.5))>.04 pigment{BodyColor}} cylinder{<-1.15,13.52*sin(radians(i*15+8.0)),13.52*cos(radians(i*15+8.0))><-.95,13.52*sin(radians(i*15+8.0)),13.52*cos(radians(i*15+8.0))>.04 pigment{BodyColor}} cylinder{<-1.15,13.52*sin(radians(i*15+7.0)),13.52*cos(radians(i*15+7.0))><-.95,13.52*sin(radians(i*15+7.0)),13.52*cos(radians(i*15+7.0))>.04 pigment{BodyColor}} cylinder{<-1.15,13.52*sin(radians(i*15+7.5)),13.52*cos(radians(i*15+7.5))><-.95,13.52*sin(radians(i*15+7.5)),13.52*cos(radians(i*15+7.5))>.04 pigment{BodyColor}} #declare i=i+1; #end //スポーク終わり //バラのマーク #declare rosemark=union{ difference{ height_field{png "rose1.png" smooth pigment{NeonBlue} translate<-.5,0,-.5> //finish{phong 1 reflection 0.1} } plane{y,0.9 pigment{NeonBlue}} } difference{ height_field{png "rose2.png" smooth pigment{BodyColor} translate<-.5,0,-.5> //finish{phong 1 reflection .1} } plane{y,.8 pigment{BodyColor}} plane{-y,-.9 pigment{BodyColor}} } difference{ height_field{png "rose3.png" smooth pigment{BodyColor} translate<-.5,0,-.5> //finish{phong 1 reflection .1} } plane{ y, .7 pigment{BodyColor}} plane{-y,-.8 pigment{BodyColor}} } } object{rosemark rotate<0,-90,-90>scale<0,10,10>translate 5.5*x} //バラのマーク終わり sphere{<0,0,0>1 hollow texture{pigment{bozo turbulence .9 color_map{[ .4 NewMidnightBlue] [ .9 White] } } finish{ambient 1 diffuse 0}} scale 1000 rotate x*180} //background{NewMidnightBlue} |