#include "colors.inc" #include "shapes.inc" // 左脚の定義 #declare LegL = merge { object { Disk_Y scale <0.4, 0.6, 0.4> pigment { color Blue } } intersection { // Foot object { Sphere scale <0.6, 0.3, 0.6> } object { Cube translate 1*y } pigment { color White } translate -0.6*y } translate -0.6*y } // 右脚の定義(左脚の鏡像) #declare LegR = object { LegL scale -x } // 左腕の定義 #declare ArmL = merge { object { Disk_X scale <0.7, 0.3, 0.3> pigment { color Blue } } object { Sphere scale 0.4 translate 0.7*x pigment { color White } } translate 0.7*x } // 右腕の定義(左腕の鏡像) #declare ArmR = object { ArmL scale -x } // 胴体の定義 #declare Body = merge { object { Sphere scale 1.6 pigment { color Blue } } object { Sphere scale 1.4 translate <0, 0, -0.4> pigment { color White } } } // 頭の定義 #declare Head = merge { object { Sphere scale 2 pigment { color Blue } } object { Sphere scale 1.6 translate <0, -0.4, -0.6> pigment { color White } } object { Sphere scale 0.3 translate <0, 0, -2.2> pigment { color Red } } } // 目玉の定義 // ROT:左右方向の回転角度 #macro Eye(ROT) merge { object { Sphere scale <0.5, 0.7, 0.5> pigment { color White } } object { Sphere scale <0.2, 0.2, 0.05> translate -0.5*z pigment { color Black } } rotate ROT*y } #end // 口の定義 // OPEN:上下方向の開き幅 #macro Mouth(OPEN) intersection { object { Sphere } object { Cube translate -1*y } scale OPEN*y pigment { color Red } } #end // キャラクタ全体の階層的定義 // MO:口のOPEN,ER:右目のROT,EL:左目のROT #macro Dora(MO, ER, EL) merge { merge { object { Body } object { ArmL translate < 1.2, 0.5, 0.0> } object { ArmR translate <-1.2, 0.5, 0.0> } object { LegL translate < 0.6, -1.3, 0.0> } object { LegR translate <-0.6, -1.3, 0.0> } } merge { difference { object { Head } object { Mouth(MO) translate <0, -0.5, -1.7> } } object { Eye(ER) translate <-0.5, 0.3, -1.7> } object { Eye(EL) translate <+0.5, 0.3, -1.7> } translate 2.4*y } } #end // キャラクタの配置 object { Dora(0.1, -30, -15) translate -5*x } object { Dora(0.3, -15, 15) translate 0*x } object { Dora(0.5, 15, 30) translate 5*x } /* // 座標軸 object { Cylinder_X scale 0.02 pigment{color Red} } // x軸 object { Cylinder_Y scale 0.02 pigment{color Green} } // y軸 object { Cylinder_Z scale 0.02 pigment{color Blue} } // z軸 */ // 背景 background { color LightBlue } // 照明 light_source { <100, 100, -600> // 照明の位置 color White*2 parallel point_at <0, 0, 0> } // カメラ camera{ location <5.0, 5.0, -20.0> // カメラの位置 look_at <0.0, 3.0, 0.0> // カメラの注目する位置 angle 35 // カメラの視野角 }