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

螺線階段を #declare #whileで作る


サンプル box05A.pov

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

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

//カメラ設定
camera{
    location < 20,20,-25>
    look_at <0,9,0>
    angle 53
}
//ライト設定
light_source{
    <25,45,-25> color White*1.8
}

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

// 座標系の表示
// Z軸
cylinder{<0,0,-5>,<0,0,14>,0.05
pigment{color Red}
finish{phong 1 reflection 0.1}
}
cone{<0,0,14>,0.3
<0,0,15.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,15.5>
}
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,15.5>
}
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,15.5>
}
// X軸
cylinder{<-5,0,0>,<9,0,0>,0.05
pigment{color Green}
finish{phong 1 reflection 0.1}
}
cone{<9,0,0>,0.3
<10.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 <10,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 <10,1.1,0>
}

// Y軸
cylinder{<0,-5,0>,<0,18,0>,0.05
pigment{color Blue}
finish{phong 1 reflection 0.1}
}
cone{<0,18,0>,0.3
<0,19.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,19.5,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
finish{phong 1 reflection 0.1}
translate <0,19.5,0>
}
cylinder{ <0,0,0>, <0,-0.5,0>,0.08
pigment{color Blue}
finish{phong 1 reflection 0.1}
translate <0,19.5,0>
}

//■■■らせん階段の図形操作■■■
box{<0,0,-0.5>,<6,1,0.5>
pigment{color Red} //オリジナル
}

//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-15 //Y軸に回転移動
translate <0,1,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-30 //Y軸に回転移動
translate <0,2,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-45 //Y軸に回転移動
translate <0,3,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-60 //Y軸に回転移動
translate <0,4,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-75 //Y軸に回転移動
translate <0,5,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-90 //Y軸に回転移動
translate <0,6,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-105 //Y軸に回転移動
translate <0,7,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-120 //Y軸に回転移動
translate <0,8,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-135 //Y軸に回転移動
translate <0,9,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-135 //Y軸に回転移動
translate <0,9,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-150 //Y軸に回転移動
translate <0,10,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-165 //Y軸に回転移動
translate <0,11,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-180 //Y軸に回転移動
translate <0,12,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-195 //Y軸に回転移動
translate <0,13,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-210 //Y軸に回転移動
translate <0,14,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-225 //Y軸に回転移動
translate <0,15,0> //オリジナルの平行移動
}
//回転+平行移動
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5,0.8,0.7>} //オリジナル
rotate y*-240 //Y軸に回転移動
translate <0,16,0> //オリジナルの平行移動
}

background{color White}

サンプル box05B.pov

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

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

//カメラ設定
camera{
    location < 20,20,-25>
    look_at <0,9,0>
    angle 53
}
//ライト設定
light_source{
    <25,45,-25> color White*1.8
}

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

// 座標系の表示
// Z軸
cylinder{<0,0,-5>,<0,0,14>,0.05
pigment{color Red}
finish{phong 1 reflection 0.1}
}
cone{<0,0,14>,0.3
<0,0,15.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,15.5>
}
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,15.5>
}
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,15.5>
}
// X軸
cylinder{<-5,0,0>,<9,0,0>,0.05
pigment{color Green}
finish{phong 1 reflection 0.1}
}
cone{<9,0,0>,0.3
<10.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 <10,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 <10,1.1,0>
}

// Y軸
cylinder{<0,-5,0>,<0,19,0>,0.05
pigment{color Blue}
finish{phong 1 reflection 0.1}
}
cone{<0,19,0>,0.3
<0,20.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,20.5,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
finish{phong 1 reflection 0.1}
translate <0,20.5,0>
}
cylinder{ <0,0,0>, <0,-0.5,0>,0.08
pigment{color Blue}
finish{phong 1 reflection 0.1}
translate <0,20.5,0>
}

//■■■らせん階段の図形操作■■■
box{<0,0,-0.5>,<6,1,0.5>
pigment{color Red} //オリジナル
}

//回転+平行移動
#declare K=1;
#while(K<18)
box{<0,0,-0.5>,<6,1,0.5>
pigment{color rgb<0.5+0.1*K,0.02*K,1-0.01*K>}
rotate y*-15*K //Y軸に回転移動
translate <0,1*K,0> //平行移動
}
#declare K=K+1;
#end

background{color White}


[ 目次に戻る ]