Last updated: March 2008. Kajiyama             [ 目次に戻る ]

立体図形の形状を決める座標と立体図形の位置をあらわす座標 box01_2.pov


立体形状を決める座標と3次元空間の位置を決める座標を区別する
サンプル box01.pov

■■■ボックスの形状の座標表現■■■

2つの頂点の座標を指定する
box{<0,0,0>,<5,5,5>
pigment{color rgb<0.5,0.8,0.4>}
}

//box01.pov
// POV-Ray 3.6 scene file by Kajiyama

#include "colors.inc"
#include "shapes.inc"

//カメラ設定
camera{
    location < 15,15,-15>
    look_at <2,4,2>
    angle 45
}
//ライト設定
light_source{
    <15,25,-8> color White*1.6
}

// XYZ座標空間
// チェック柄の床
object{
    Plane_XZ
    pigment{checker color Gray color White*0.9}
    translate <0,0,0>
}

// 座標系の表示
// Z軸
cylinder{<0,0,-5>,<0,0,17>,0.05
pigment{color Red}
finish{phong 1 reflection 0.1}
}
cone{<0,0,17>,0.3
<0,0,18.5>,0
pigment{color Red}
}
// Z文字
cylinder{<-0.5,0.5,0>,<0.5,0.5,0>,0.08
pigment{color Red}
finish{phong 1 reflection 0.1}
translate <0,1.1,19>
}
cylinder{<0.5,0.5,0>,<-0.5,-0.5,0>,0.08
pigment{color Red}
finish{phong 1 reflection 0.1}
translate <0,1.1,19>
}
cylinder{ <-0.5,-0.5,0>, <0.5,-0.5,0>,0.08
pigment{color Red}
finish{phong 1 reflection 0.1}
translate <0,1.1,19>
}
// X軸
cylinder{<-5,0,0>,<7,0,0>,0.05
pigment{color Green}
finish{phong 1 reflection 0.1}
}
cone{<7,0,0>,0.3
<8.5,0,0>,0
pigment{color Green}
}
// X文字
cylinder{<-0.5,-0.5,0>,<0.5,0.5,0>,0.08
pigment{color Green}
finish{phong 1 reflection 0.1}
rotate y*90
translate <9,1.1,0>
}
cylinder{ <-0.5,0.5,0>, <0.5,-0.5,0>,0.08
pigment{color Green}
finish{phong 1 reflection 0.1}
rotate y*90
translate <9,1.1,0>
}

// Y軸
cylinder{<0,-5,0>,<0,7,0>,0.05
pigment{color Blue}
finish{phong 1 reflection 0.1}
}
cone{<0,7,0>,0.3
<0,8.5,0>,0
pigment{color Blue}
}
// Y文字
cylinder{<-0.5,0.5,0>,<0,0,0>,0.08
pigment{color Blue}
finish{phong 1 reflection 0.1}
translate <0,9,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
finish{phong 1 reflection 0.1}
translate <0,9,0>
}
cylinder{ <0,0,0>, <0,-0.5,0>,0.08
pigment{color Blue}
finish{phong 1 reflection 0.1}
translate <0,9,0>
}

//■■■ボックスの形状の座標表現 ■■■
box{<0,0,0>,<5,5,5> /* 立体の形状を2頂点の座標で指定 */
pigment{color rgb<0.5,0.8,0.4>}
}

サンプル box01_2.pov

■■■ 空間配置を座標表現 ■■■

立体形状はいつも原点まわりで作成する.
これを translate で3次元空間に配置する
box01.povを、translate <x,y,z>で
平行移動し配置する

//box01_2.pov
// POV-Ray 3.6 scene file by Kajiyama

#include "colors.inc"
#include "shapes.inc"

//カメラ設定
camera{
    location < 15,15,-15>
    look_at <2,4,2>
    angle 45
}
//ライト設定
light_source{
    <15,25,-8> color White*1.6
}

// XYZ座標空間
// チェック柄の床
object{
    Plane_XZ
    pigment{checker color Gray color White*0.9}
    translate <0,0,0>
}

// 座標系の表示
// Z軸
cylinder{<0,0,-5>,<0,0,17>,0.05
pigment{color Red}
finish{phong 1 reflection 0.1}
}
cone{<0,0,17>,0.3
<0,0,18.5>,0
pigment{color Red}
}
// Z文字
cylinder{<-0.5,0.5,0>,<0.5,0.5,0>,0.08
pigment{color Red}
finish{phong 1 reflection 0.1}
translate <0,1.1,19>
}
cylinder{<0.5,0.5,0>,<-0.5,-0.5,0>,0.08
pigment{color Red}
finish{phong 1 reflection 0.1}
translate <0,1.1,19>
}
cylinder{ <-0.5,-0.5,0>, <0.5,-0.5,0>,0.08
pigment{color Red}
finish{phong 1 reflection 0.1}
translate <0,1.1,19>
}
// X軸
cylinder{<-5,0,0>,<7,0,0>,0.05
pigment{color Green}
finish{phong 1 reflection 0.1}
}
cone{<7,0,0>,0.3
<8.5,0,0>,0
pigment{color Green}
}
// X文字
cylinder{<-0.5,-0.5,0>,<0.5,0.5,0>,0.08
pigment{color Green}
finish{phong 1 reflection 0.1}
rotate y*90
translate <9,1.1,0>
}
cylinder{ <-0.5,0.5,0>, <0.5,-0.5,0>,0.08
pigment{color Green}
finish{phong 1 reflection 0.1}
rotate y*90
translate <9,1.1,0>
}

// Y軸
cylinder{<0,-5,0>,<0,7,0>,0.05
pigment{color Blue}
finish{phong 1 reflection 0.1}
}
cone{<0,7,0>,0.3
<0,8.5,0>,0
pigment{color Blue}
}
// Y文字
cylinder{<-0.5,0.5,0>,<0,0,0>,0.08
pigment{color Blue}
finish{phong 1 reflection 0.1}
translate <0,9,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
finish{phong 1 reflection 0.1}
translate <0,9,0>
}
cylinder{ <0,0,0>, <0,-0.5,0>,0.08
pigment{color Blue}
finish{phong 1 reflection 0.1}
translate <0,9,0>
}

//■■■ボックスの空間位置の表現 ■■■
box{<0,0,0>,<5,5,5> /* 立体の形状を2頂点の座標で指定 */
pigment{color rgb<0.5,0.8,0.4>}

translate <3,0,3> /* 立体の位置を <3,0,3>座標で指定する */
}


[ 目次に戻る ]