次の include文で、ここで示しているすべてのものを使用することができる。

#include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc"


▷ 前の「14.10 形状2」へ


14.11 形状3a

POV-Rayでは、プリミティブとしてさまざまな形状が用意されているが、インクルードファイルには違った形状が定義されている。ここでは、shapes3.inc に含まれている主なもの(a)を示す。

形状3a/3b を使うために必要なインクルード文

#include "shapes3.inc"

ここには次の形状がある。

 ▷ 14.11-1 部分トーラス[Segment_of_Torus]
 ▷ 14.11-2 部分 円柱リング[Segment_of_CylinderRing]
 ▷ 14.11-3 ファセット球[Facetted_Sphere]
 ▷ 14.11-4 リング球[Ring_Sphere]
 ▷ 14.11-5 ファセット卵[Facetted_Egg]
 ▷ 14.11-6 卵[Egg]
 ▷ 14.11-7 正多角柱[Column_N_AB]
 ▷ 14.11-8 ピラミッド[Pyramid_N_AB]


14.11-1 部分トーラス[Segment_of_Torus]

部分トーラスは、角度の設定により部分的なトーラスを生成できる。

図14.11-1a 部分トーラス[Segment_of_Torus]

部分トーラスは、下図14.11-1b のような位置に生成される。角度は、正の x 軸上から始まる y 軸回りの角度で設定する。下図は 270 度を設定した例である。角度をマイナス(-)にすると逆方向に生成される。

図14.11-1b 部分トーラスの生成位置

//----------------- Fig.14.11-1a Segment_of_Torus #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100,-400,500> color rgb 1.5} //================================== Segment_of_Torus #declare T1=texture {T_Gold_1C} #declare T2=texture{T_Grnt13 } object{ Segment_of_Torus(2.5, 0.3, 270) texture { T1 } scale 1 rotate <90,0,-25> translate <0,-1,0> } object{ Segment_of_Torus(1.5, 0.4, 160) texture { T2 } scale <1,1,1> rotate <180,0,40> translate <1.8,1,-0.5> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, -1.01 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//---------------- Fig.14.11-1b Segment_of_Torus #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0.7> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //============================== Segment_of_Torus object{ Segment_of_Torus ( 1.5,0.4,270 ) texture{pigment{ rgbf<1,1,0,0.3>} finish { phong 1} } } //--------------------------------coordinate axis #declare SX=4.5; #declare SY=3.5; #declare SZ=3.2; #declare SC=0.7; union{ union{ cylinder{x*-5,x*(SX-0.5),0.05} cone{x*(SX-0.5),0.1,x*(SX+0.1),0} text{ttf "cyrvetic.ttf","X",0.1,0 scale SC rotate<90,0,-30> translate <SX+0.4, 0, -0.5> } pigment{color rgb<0.2,1,0.2>} } union{ cylinder{y*-5,y*(SY+0.5),0.05} cone{y*(SY+0.5),0.1,y*(SY+1.1),0} text{ttf "cyrvetic.ttf","Y",0.1,0 scale SC rotate<90,0,-30> translate <-0.1,SY+2,-0.5> } pigment{color rgb<0.2,0.2,1.0>} } union{ cylinder{z*-5,z*(SZ-0.5),0.05} cone{z*(SZ-0.5),0.1,z*(SZ+0.1),0} text{ttf "cyrvetic.ttf","Z",0.1,0 scale SC rotate<90,0,120> translate <-0.2,0.2,SZ-0.2> } pigment{color rgb<1.0,0.2,0.2>} } }

< Segment_of_Torus の構文 >

object{ Segment_of_Torus ( Major_Radius , Minor_Radius , Seg_Angle ) [ OBJECT_MODIFIERS... ]
}
object 物体のキーワード
Segment_of_Torus 部分トーラス
Major_Radius 大半径(トーラスの大きさ)
Minor_Radius 小半径(トーラスの太さ)
Seg_Angle トーラス生成の角度
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

 


14.11-2 部分 円柱リング[Segment_of_CylinderRing]

部分 円柱リングは、角度の設定により部分的な円柱リングを生成できる。

図14.11-2a 部分 円柱リング[Segment_of_CylinderRing]

部分 円柱リングは、下図14.11-2b のような位置に生成される。角度は、正の x 軸上から始まる y 軸回りの角度で設定する。下図は 270 度を設定した例である。角度をマイナス(-)にすると逆方向に生成される。

図14.11-2b 部分 円柱リングの生成位置

//---------- Fig.14.11-2a Segment_of_CylinderRing #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100,-400,500> color rgb 1.5} //=========================== Segment_of_CylinderRing #declare T1=texture{Yellow_Pine} #declare T2=texture{Silver1 } object{ Segment_of_CylinderRing(1.5,1.2,2,260) texture {T1} scale 1 rotate <90,0,-25> translate <-1,-1,0> } object{ Segment_of_CylinderRing(2,1.2,0.7,150) texture {T2} scale 1 rotate <90,0,-120> translate <0,-1.5,0> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//------------- Fig.14.11-2b Segment_of_CylinderRing #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0.7> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //=========================== Segment_of_CylinderRing object{ Segment_of_CylinderRing( 1.5,1.0,0.8,270 ) texture {pigment{rgbf<1,1,0,0.3>} finish {phong 1}} } //--------------------------------coordinate axis #declare SX=4.5; #declare SY=3.5; #declare SZ=3.2; #declare SC=0.7; union{ union{ cylinder{x*-5,x*(SX-0.5),0.05} cone{x*(SX-0.5),0.1,x*(SX+0.1),0} text{ttf "cyrvetic.ttf","X",0.1,0 scale SC rotate<90,0,-30> translate <SX+0.4, 0, -0.5> } pigment{color rgb<0.2,1,0.2>} } union{ cylinder{y*-5,y*(SY+0.5),0.05} cone{y*(SY+0.5),0.1,y*(SY+1.1),0} text{ttf "cyrvetic.ttf","Y",0.1,0 scale SC rotate<90,0,-30> translate <-0.1,SY+2,-0.5> } pigment{color rgb<0.2,0.2,1.0>} } union{ cylinder{z*-5,z*(SZ-0.5),0.05} cone{z*(SZ-0.5),0.1,z*(SZ+0.1),0} text{ttf "cyrvetic.ttf","Z",0.1,0 scale SC rotate<90,0,120> translate <-0.2,0.2,SZ-0.2> } pigment{color rgb<1.0,0.2,0.2>} } }

< Segment_of_CylinderRing の構文 >

object{ Segment_of_CylinderRing ( Out_Radius , In_Radius , Height , Seg_Angle ) [ OBJECT_MODIFIERS... ] }
object 物体のキーワード
Segment_of_CylinderRing 部分 円柱リング
Out_Radius 外側の円柱半径
In_Radius 内側の円柱半径
Height 高さ(幅、y 軸方向)
Seg_Angle 円柱リング生成の角度
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

 


14.11-3 ファセット球[Facetted_Sphere]

ファセット球は、小面で構成された球体である。

図14.11-3a ファセット球[Facetted_Sphere]

ファセット球は、小面で構成された球体で、内接球の半径が 1 である。下図14.11-3b のように原点に生成される。小面は y 軸を通る面と xz 平面に平行な面で球を分割した交点から構成される面である。

図14.11-3b ファセット球の生成位置

//--------------- Fig.14.11-3a Facetted_Sphere #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100, -400, 500> color rgb 1.5} //============================== Facetted_Sphere #declare T1=texture{T_Gold_1C} #declare T2=texture{ pigment{granite color_map{ [0.0 color rgb<0.8,0.4,0.2>] [0.7 White] } scale 0.6 } } object{ Facetted_Sphere( 6,12 ) texture {T1} scale 0.7 rotate <90,0,0> translate<-1.3,-4,2> } object{ Facetted_Sphere( 3, 8 ) texture {T2} scale 1 rotate <90,0,0> translate<1,-3,2> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//-------------- Fig.14.11-3b Facetted_Sphere #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0.7> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //============================== Facetted_Sphere object{ Facetted_Sphere( 3, 8 ) texture { pigment{ rgbf<1,1,0,0.3>} finish { phong 1} } scale 1.5 } //------------------------------coordinate axis #declare SX=4.5; #declare SY=3.5; #declare SZ=3.2; #declare SC=0.7; union{ union{ cylinder{x*-5,x*(SX-0.5),0.05} cone{x*(SX-0.5),0.1,x*(SX+0.1),0} text{ttf "cyrvetic.ttf","X",0.1,0 scale SC rotate<90,0,-30> translate <SX+0.4, 0, -0.5> } pigment{color rgb<0.2,1,0.2>} } union{ cylinder{y*-5,y*(SY+0.5),0.05} cone{y*(SY+0.5),0.1,y*(SY+1.1),0} text{ttf "cyrvetic.ttf","Y",0.1,0 scale SC rotate<90,0,-30> translate <-0.1,SY+2,-0.5> } pigment{color rgb<0.2,0.2,1.0>} } union{ cylinder{z*-5,z*(SZ-0.5),0.05} cone{z*(SZ-0.5),0.1,z*(SZ+0.1),0} text{ttf "cyrvetic.ttf","Z",0.1,0 scale SC rotate<90,0,120> translate <-0.2,0.2,SZ-0.2> } pigment{color rgb<1.0,0.2,0.2>} } }

< Facetted_Sphere の構文 >

object{ Facetted_Sphere ( Quarter_Seg_Number , Radial_Seg_Number ) [ OBJECT_MODIFIERS... ] }
object 物体のキーワード
Facetted_Sphere ファセット球
Quarter_Seg_Number xz 平面における半球の分割数(例:上図で 3 )
Radial_Seg_Number y 軸回り分割数(例:上図で 8 )
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

 


14.11-4 リング球[Ring_Sphere]

ワイヤーフレームの球体である。トーラスを球体になるように配置している。

図14.11-4a リング球[Ring_Sphere]

下図14.11-4b に示すように、リング球は原点に生成される。トーラスは中心が原点で両端が y 軸を通る放射状のものと、中心が y 軸で xz 平面に平行なトーラスから球体が構成される。

図14.11-4b リング球の生成位置

//------------------ Fig.14.11-4a Ring_Sphere #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100,-400,500> color rgb 1.5} //====================================== Ring_Sphere #declare T1=texture{ pigment{Coral} finish{ phong 1}} #declare T2=texture{ pigment{LightBlue} finish{ phong 1}} object{ Ring_Sphere ( 1.3, 1.3, 0.035, 0.035 , 6, 7) texture { T1 } scale 1 rotate <90,0,0> translate<-1,-3,2> } object{ Ring_Sphere ( 1.3, 1.3, 0.03, 0.04 , 6, 7) texture { T2 } scale 0.8 rotate <90,0,0> translate<1.5,-3,2> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//---------------- Fig.14.11-4b Ring_Sphere #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0.7> angle 5.8 } light_source{ <200,400, 300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //================================ Ring_Sphere object{ Ring_Sphere ( 1.3,1.3,0.03,0.03,5,5) texture{pigment{ rgbf<1,1,0,0.3>} finish { phong 1} } scale 1.5 } //----------------------------coordinate axis #declare SX=4.5; #declare SY=3.5; #declare SZ=3.2; #declare SC=0.7; union{ union{ cylinder{x*-5,x*(SX-0.5),0.05} cone{x*(SX-0.5),0.1,x*(SX+0.1),0} text{ttf "cyrvetic.ttf","X",0.1,0 scale SC rotate<90,0,-30> translate <SX+0.4, 0, -0.5> } pigment{color rgb<0.2,1,0.2>} } union{ cylinder{y*-5,y*(SY+0.5),0.05} cone{y*(SY+0.5),0.1,y*(SY+1.1),0} text{ttf "cyrvetic.ttf","Y",0.1,0 scale SC rotate<90,0,-30> translate <-0.1,SY+2,-0.5> } pigment{color rgb<0.2,0.2,1.0>} } union{ cylinder{z*-5,z*(SZ-0.5),0.05} cone{z*(SZ-0.5),0.1,z*(SZ+0.1),0} text{ttf "cyrvetic.ttf","Z",0.1,0 scale SC rotate<90,0,120> translate <-0.2,0.2,SZ-0.2> } pigment{color rgb<1.0,0.2,0.2>} } }

< Ring_Sphere の構文 >

object{ Ring_Sphere ( H_Maj_Radius , V_Maj_Radius , H_Min_Radius , V_Min_Radius , H_Ring_Number , V_Ring_Number ) [ OBJECT_MODIFIERS... ] bb>}
object 物体のキーワード
Ring_Sphere リング球
H_Maj_Radius 平行リングの半径(大きさ)
V_Maj_Radius 放射状リングの半径(大きさ)
H_Min_Radius 平行リング断面の半径(太さ)
V_Min_Radius 放射状リング断面の半径(太さ)
H_Ring_Number 平行リングの数(中心 y 軸)
V_Ring_Number 放射状リングの数(中心 原点)
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

※ 放射状リング: y 軸を通るリング、偶数のときはリング数は半分になる。
※ 平行リング: xz 面を通るリング

 


14.11-5 ファセット卵[Facetted_Egg]

卵の形をした形状で、小面で構成されている。

図14.11-5a ファセット卵[Facetted_Egg]

ファセット卵は、下図14.11-5b のように底面が原点に接するように生成される。小面は y 軸を通る面と xz 平面に平行な面で球を分割した交点から構成される面である。

図14.11-5b ファセット卵の生成位置

//------------------ Fig.14.11-5a Facetted_Egg #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100,-400,500> color rgb 1.5} //======================================= Facetted_Egg #declare T1=texture{Yellow_Pine } #declare T2=texture{T_Copper_5A finish{ phong 1} normal{ bumps 0.3 scale 0.02 } } object{ Facetted_Egg( 3, 8 ) texture{T1} scale 1.2 rotate x*90 translate<-1.2,-4.5,1> } object{ Facetted_Egg( 5,10 ) texture{T2} scale 1.8 rotate z*30 translate<2.2,-2,1> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//------------------ Fig.14.11-5b Facetted_Egg #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0.7> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //======================================= Facetted_Egg object{ Facetted_Egg( 3, 8 ) texture { pigment{rgbf<1,1,0,0.3>} finish{phong 1} } scale 1.5 } //--------------------------------coordinate axis #declare SX=4.5; #declare SY=3.5; #declare SZ=3.2; #declare SC=0.7; union{ union{ cylinder{x*-5,x*(SX-0.5),0.05} cone{x*(SX-0.5),0.1,x*(SX+0.1),0} text{ttf "cyrvetic.ttf","X",0.1,0 scale SC rotate<90,0,-30> translate <SX+0.4, 0, -0.5> } pigment{color rgb<0.2,1,0.2>} } union{ cylinder{y*-5,y*(SY+0.5),0.05} cone{y*(SY+0.5),0.1,y*(SY+1.1),0} text{ttf "cyrvetic.ttf","Y",0.1,0 scale SC rotate<90,0,-30> translate <-0.1,SY+2,-0.5> } pigment{color rgb<0.2,0.2,1.0>} } union{ cylinder{z*-5,z*(SZ-0.5),0.05} cone{z*(SZ-0.5),0.1,z*(SZ+0.1),0} text{ttf "cyrvetic.ttf","Z",0.1,0 scale SC rotate<90,0,120> translate <-0.2,0.2,SZ-0.2> } pigment{color rgb<1.0,0.2,0.2>} } }

< Facetted_Egg の構文 >

object{ Facetted_Egg ( Quarter_Seg_Number , Radial_Seg_Number ) [ OBJECT_MODIFIERS... ] }
object 物体のキーワード
Facetted_Egg ファセット卵
Quarter_Seg_Number xz 平面における半球の分割数(例:上図で 3 )
Radial_Seg_Number y 軸回り分割数(例:上図で 8 )
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

 


14.11-6 卵[Egg]

卵の形状をした楕円体のような立体である。

図14.11-6a 卵[Egg]

卵は、下図14.11-6b のように底面が原点に接するように生成される。卵は、半径 1 の球を y 軸方向に下半分を 1.15 倍、上半分を 1.55 倍に拡大したものである。

図14.11-6b 卵の生成位置

//---------------------------- Fig.14.11-6a Egg #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100,-400,500> color rgb 1.5} //================================================ Egg #declare T1=texture{T_Gold_1C} #declare T2=texture{pigment{Wheat*1.2} normal{bumps 0.15 scale 0.01} finish{phong 0.5} } object{ Egg texture{T1} scale 1 rotate <90,0,0> translate<-1.3,-3,1> } object{ Egg texture{T2} scale 1.3 rotate <90,0,0> translate<1,-4,1> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//---------------------------- Fig.14.11-6b Egg #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0.7> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //======================================== Egg object{ Egg texture { pigment{ rgbf<1,1,0,0.3>} finish { phong 1} } scale 1.5 } //--------------------------------coordinate axis #declare SX=4.5; #declare SY=3.5; #declare SZ=3.2; #declare SC=0.7; union{ union{ cylinder{x*-5,x*(SX-0.5),0.05} cone{x*(SX-0.5),0.1,x*(SX+0.1),0} text{ttf "cyrvetic.ttf","X",0.1,0 scale SC rotate<90,0,-30> translate <SX+0.4, 0, -0.5> } pigment{color rgb<0.2,1,0.2>} } union{ cylinder{y*-5,y*(SY+0.5),0.05} cone{y*(SY+0.5),0.1,y*(SY+1.1),0} text{ttf "cyrvetic.ttf","Y",0.1,0 scale SC rotate<90,0,-30> translate <-0.1,SY+2,-0.5> } pigment{color rgb<0.2,0.2,1.0>} } union{ cylinder{z*-5,z*(SZ-0.5),0.05} cone{z*(SZ-0.5),0.1,z*(SZ+0.1),0} text{ttf "cyrvetic.ttf","Z",0.1,0 scale SC rotate<90,0,120> translate <-0.2,0.2,SZ-0.2> } pigment{color rgb<1.0,0.2,0.2>} } }

< Egg の構文 >

object{ Egg [ OBJECT_MODIFIERS... ] }
object 物体のキーワード
Egg
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

 


14.11-7 正多角柱[Column_N_AB]

断面が正多角形の柱である。

図14.11-7a 正多角柱[Column_N_AB]

下図14.11-7b に示すように、正N多角柱はA点とB点で指定する位置に生成される。

図14.11-7b 正多角柱の位置座標

//---------------- Fig.14.11-7a Column_N_AB #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{ <100,-400,500> color rgb 1.5} //=================================== Column_N_AB #declare T1=texture{T_Grnt25 finish{ reflection 0.3}} #declare T2=texture{T_Grnt29 scale 0.3 } object{ Column_N_AB( 5, <0,0,0>,<0,0,1>, 1 ) texture{T1} scale 1 rotate z*-10 translate<-1,-3,1> } object{ Column_N_AB( 8, <0,0,0>,<0,0,2.5>, 0.7 ) texture{T2} scale 1 translate<1.3,-4,1> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//---------------- Fig.14.11-7b Column_N_AB #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <-0.8, 0.5, 1.1> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //================================== Column_N_AB object{ Column_N_AB( 8, <0.5,0,0>,<0,3,3>, 1 ) pigment{rgbf<0.7,1,1,0.5>*1.1} finish{phong 1} } sphere {<0.5,0,0> 0.1 pigment{ rgbf<1,0.6,>*0.8} } sphere {<0,3,3> 0.1 pigment{ rgbf<1,0.6,>*0.8} }

< Column_N_AB の構文 >

object{ Column_N_AB ( N_Sides , <A_Point> , <B_Point> , Radius ) [ OBJECT_MODIFIERS... ] }
object 物体のキーワード
Column_N_AB 正多角柱
N_Sides 多角柱の辺数
<A_Point> A点の x,y,z,座標
<B_Point> B点の x,y,z,座標
Radius 多角柱の半径(内接円の半径)
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

 


14.11-8 ピラミッド[Pyramid_N_AB]

このピラミッドは、正角錐または正角錐台である。

図14.11-8a ピラミッド[Pyramid_N_AB]

下図14.11-8b に示すように、ピラミッドはA点とB点で指定する位置に生成される。

図14.11-8b ピラミッドの位置座標

//------------------ Fig.14.11-8a Pyramid_N_AB #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 25 } light_source{<100,-400,500> color rgb 1.5 parallel point_at 0 } //=================================== Pyramid_N_AB #declare T1=texture{T_Gold_1C normal{bumps 0.3 scale 0.03} } #declare T2=texture{pigment{Gold} } texture{T_Grnt20a scale 0.5} object{ Pyramid_N_AB( 10,<0,0,0>,1.2,<0,0,1.5>,0.3 ) texture {T1} scale 1 translate<-1.1,-3.2,1> } object{ Pyramid_N_AB( 6,<0,0,0>,0.6,<0,0,2>,1 ) texture {T2} scale 1 translate<1.3,-2.8,1> } //---------------------------------floor #declare CA1=rgb<0.85,0.85,0.8>; #declare CA2=rgb<0.85,0.85,0.8>*1.2; plane{ z, 0 pigment{ checker color CA1, color CA2 scale 0.3 } } //----------------sky sky_sphere{ pigment{ wrinkles color_map{ [ 0.3 SkyBlue] [ 0.9 White ] } scale <1, 0.2, 0.2> } }
//------------------ Fig.14.11-8b Pyramid_N_AB #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "skies.inc" #include "stars.inc" #include "chars.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" global_settings { assumed_gamma 2.2 } //-----------------------------camera - light camera{ location <60,60,10> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 0> angle 5.8 } light_source{ <200,400,300> color rgb 1.5} background {color rgb<1,1,0.9>*0.9 } //================================= Pyramid_N_AB object{ Pyramid_N_AB( 8,<0,-1,-0.5>,1.5,<0,2,2>,0.5 ) pigment{rgbf<0.7,1,1,0.5>*1.1} finish{phong 1} } sphere {<0,-1,-0.5> 0.1 pigment{ rgbf<1,0.6,>*0.8} } sphere {<0,2,2> 0.1 pigment{ rgbf<1,0.6,>*0.8} }

< Pyramid_N_AB の構文 >

object{ Pyramid_N_AB ( N_Sides , <A_Point> , A_Radius , <B_Point> , B_Radius ) [ OBJECT_MODIFIERS... ] }
object 物体のキーワード
Pyramid_N_AB ピラミッド
N_Sides ピラミッドの辺数
<A_Point> A点の x,y,z 座標
A_Radius A点の半径(内接円の半径)
<B_Point> B点の x,y,z 座標
B_Radius B点の半径(内接円の半径)
OBJECT_MODIFIERS... 物体の変形・テクスチャなどの設定

※ [制限] 半径 Radius_B は、半径 Radius_A より小さくする。
※ 半径 Radius_B が 0 のとき、角錐になり。それ以外は角錐台になる。


(End) 14.11 形状3a

▷ 次の「14.11 形状3b」へ