#include "colors.inc" #include "shapes.inc" #macro Bar(V) object { Disk_Y translate 1*y scale 0.5*<0.8, V, 0.8> // 長さ V の丸棒 #if (V < 0) pigment { color Red } #else pigment { color Blue } #end } #end // 棒グラフ(bar chart) object { Bar( 2.0) translate 1*x } object { Bar( 3.0) translate 2*x } object { Bar( 1.0) translate 3*x } object { Bar(-1.0) translate 4*x } object { Bar( 1.0) translate 5*x } // 座標軸 object { Cylinder_X scale 0.05 pigment{color Red} } // x軸 object { Cylinder_Y scale 0.05 pigment{color Green} } // y軸 //object { Cylinder_Z scale 0.05 pigment{color Blue} } // z軸 // 背景 background { color LightBlue } // 照明 light_source { <50, 100, -100> color White*1.5 parallel point_at <0, 0, 0> } // カメラ camera { location <3.0, 0.0, -20.0> look_at <3.0, 0.0, 0.0> angle 35 }