数想空間 / CUBES
POV-Rayは多くの関数や制御文を持っています ので、簡単に構造化してオブジェクト群を並べ ることができます。 例えば右のようにすれば、X-Y-Z空間に位置に よって色付けされた10×10×10=1000個の立方体 が並びます。 この方法でX-Z平面に展開し三角関数を加味 してやると、意外に鮮やかな古典的なコンピュ ータグラフィックスが現れます。ちょっと懐古 的に、そんな世界に遊んでみました。Y方向の 値で色付けすることにより、一層位置関係がは っきりするようにしています。
なお、参考までに、画像各々のオブジェクト |
#while (Cy < 11) #declare Cz=0 #while (Cz < 11) #declare Cx=0 #while (Cx < 11) box { <-0.15,-0.15,-0.15> <0.15,0.15,0.15> translate < Cx, Cy, Cz > pigment { color red 1-Cx/10 green Cy/10 blue 1-Cz/10} } #declare Cx=Cx+1 #end #declare Cz=Cz+1 #end #declare Cy=Cy+1 #end |
#if ( C<3.1415*1.2 ) box { <-0.15,-0.15,-0.15> <0.15,0.15,0.15> translate finish {phong 0.3 ambient 0.5} pigment {color red 1-sin(C-3.1415/2) green 0.2-0.2*sin(C-3.1415/2) blue sin(C-3.1415/2)} } |
box { <-0.15,-0.15,-0.15> <0.15,0.15,0.15> translate < Cx, C, Cz > finish {phong 0.3 ambient 0.5} pigment {color red 1-C green 0.2+0.3*C blue C} } |
box { <-0.15,-0.15,-0.15> <0.15,0.15,0.15> translate < Cx, Ct, Cz> finish {phong 0.2 ambient 0.3} pigment {color red 1-0.5*C green 0.8-0.1*C*C blue 0.5*C} } |
# if ( C>0 ) #declare C=sqrt(C) box { <-0.15,-0.15,-0.15> < 0.15,0.15,0.15> translate < Cx, C, Cz> finish {phong 0.2 ambient 0.3} pigment {color red 1+C/20 green 0.2+C/50 blue -C/20} } box { <-0.15,-0.15,-0.15> <0.15,0.15,0.15> translate < Cx, -C, Cz> finish {phong 0.2 ambient 0.3} pigment {color red 1-C/20 green 0.2-C/50 blue C/20} } |