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

立体図形の形状(box)を <x,y,z>座標で作る box01.pov box02.pov



立体の形状は<x,y,z>座標で指示する

サンプル 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> //頂点の座標を指定する
pigment{color rgb<0.5,0.8,0.4>}
}


サンプル box02.pov

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

#include "colors.inc"
#include "shapes.inc"
//カメラ設定
camera{
    location < 15,15,-15>
    look_at <4,2,4>
    angle 55
}
//ライト設定
light_source{
    <-15,20,-20> 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,7>,0.05
pigment{color Red}
finish{phong 1 reflection 0.1}
}
cone{<0,0,7>,0.3
<0,0,8.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,9>
}
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,9>
}
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,9>
}
// 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>
}

//■■■ボックスの座標表現 A■■■
box{<0,0,0>,<1,1,1>
pigment{color rgb<0.5,0.8,0.4>}
}
//■■■ボックスの座標表現 B■■■
box{<2,0,2>,<4,2,4>
pigment{color rgb<0.6,0.6,0.5>}
}
//■■■ボックスの座標表現 C■■■
box{<5,0,2>,<8,3,5>
pigment{color rgb<0.5,0.3,0.5>}
}
//■■■ボックスの座標表現 D■■■
box{<9,0,2>,<13,4,6>
pigment{color rgb<0.5,0.8,0.5>}
}
//■■■ボックスの座標表現 E■■■
box{<-0.5,0,-0.5>,<-1,0.5,-1>
pigment{color rgb<0.5,0.3,0.5>}
}

background{color White}


[ 目次に戻る ]