NUMERICAL SPACE / CUBES
POV-Ray has many internal functins and control comands. So we can easily make arranged groups of objects. For example, you can get 10x10x10=1000 cubes in the X-Y-Z space by the script I show right. They will be colored one by one with the position. I can get tipical computer graphics by this way on X-Z plane and trigonometrical functions or other. Images in this page are those I got from that. I colored them by the value of Y direction to show their structure clearly.
I wrote functions I used for all images |
#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} finish {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} } | |