次の 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.8 天空

天空は、textures.incskies.incstars.inc に定義されている。天空の一覧を以下に示す。

  天空 ▷「7.2 天空(sky_sphere)」参照

次の天空を使うために必要なインクルード文

#include "textures.inc"


pigment {Clouds}
(雲のみ青空なし)

pigment {FBM_Clouds}
(雲のみ青空なし)

pigment {Blue_Sky}

pigment {Bright_Blue_Sky}

pigment {Blue_Sky2}

pigment {Blue_Sky3}

pigment {Blood_Sky}

pigment {Apocalypse}
 

次の天空を使うために必要なインクルード文

#include "skies.inc"


object {O_Cloud1}
(雲のみ青空なし)

object {O_Cloud2}
(雲のみ青空なし)

pigment {P_Cloud1}
(雲のみ青空なし)
   

pigment {P_Cloud2}

pigment {P_Cloud3}

S_Cloud1

S_Cloud2

S_Cloud3

S_Cloud4

S_Cloud5
   
 

次の天空(夜空)を使うために必要なインクルード文

#include "stars.inc"


texture {Starfield1}

texture {Starfield2}

texture {Starfield3}

texture {Starfield4}

texture {Starfield5}

texture {Starfield6}
 


< 天空の利用 >

昼間の天空には、次のインクルードファイル文を記述する。

#include "textures.inc"
#include "skies.inc"

これら2つのインクルードファイルには、sky_sphere で使用できる天空や雲がある。天空は雲を含めて定義されている。雲のみが定義されているものが5種類、雲を含む天空が定義されているものが13種類ある。

※ インクルードファイルで定義されている天空や雲は、すべて y 軸方向が天頂となっている。 z 軸方向を天頂にするために、これらの天空や雲を x 軸まわりに +90 度回転して使う。具体的には、rotate x*90 を付加する。それらを以下の POV-Rayソース に示す。


14.8 (a) 雲

雲は、天空が定義されていないので、雲だけだと空のない天空になる。雲は雲以外の部分は透明なので、他の天空と一緒に使用する。

sky_sphere 文の中に雲を pigment 文として記述するものは次の3つである。

 pigment { Clouds } (textures.inc)
 pigment { FBM_Clouds } (textures.inc)
 pigment { P_Cloud1 } (skies.inc)

FBM_Clouds と P_Cloud1 は同じものである。雲の pigment 文は天空の pigment 文より後に記述する。前に記述すると、天空は不透明なので雲が見えなくなる。 また、物体(オブジェクト)として定義されている雲は次の2つである。

 object{ O_Cloud1 } (skies.inc)
 object{ O_Cloud2 } (skies.inc)

これらはいづれも他の天空や雲と併用できる。雲は一様ではないので、見る方向などによりかなり変化がある。従って、同じ視点でも、雲の z 軸の回転やスケーリングするとかなり雲が変化する。

図14.8 (a) 雲 O_Cloud1 がある天空

上記の図14.8(a) に、天空にincファイルに定義されている雲を使用した例を示す。これらは雲のみの定義であり4種類ある。例ではその中の O_Cloud1 を使っている。POV-Rayソースでは、他の雲はコメントアウトになっているので、コメントを変更すれば使える。雲のみの定義は同時に複数使うことができる。

//-------------------- Fig. 14.8(a) sky + O_Cloud1 #version 3.7 #include "colors.inc" #include "textures.inc" #include "stones.inc" #include "skies.inc" global_settings {assumed_gamma 2.2} camera{ location<0,-4,2.5> sky<0,0,1> right <-image_width/image_height,0,0> look_at<0,0,3> angle 60 } //-------------------------parallel light light_source {<600,-250,500> color 1.5 parallel } //===%%%================================= sky (start) sky_sphere{ pigment{ //-------------------- sky gradient z color_map{ [0.0 White*0.8] [0.5 SkyBlue*1.0] } } //-------------------inc--- pigment cloud // pigment{ Clouds rotate x*90 rotate z*0 scale 1} // pigment{ P_Cloud1 rotate x*90 rotate z*0 scale 1} } //----------------------inc--- object-clouds object{ O_Cloud1 rotate x*90 rotate z*30 } // object{ O_Cloud2 rotate x*90 rotate z*0 } //===%%%================================= sky (end) //-------------------------ground plane{z,0 pigment{rgb<0.75,0.8,0.5>*1.2} normal{granite 0.3 scale 10} finish{phong 1 specular 0.3} } //------------------------- fog fog{ fog_type 2 distance 150 color White*0.6 fog_offset 0.1 fog_alt 5.0 turbulence 0.5 rotate x*90 } //---------------------------object union{ box{ 0,1 scale <2,4,2> texture {T_Grnt0 scale 2} rotate z*-50 translate <3.5,1,0> finish{ambient rgb 0.35} } box{ 0,1 scale <5,8,1> texture {T_Stone8 scale 1} rotate z*-50 translate <-2.2,1.5,0> finish{ambient rgb 0.35} } translate y*10 }

14.8 (b) 天空1

インクルードファイルにある天空で、pigment 文で記述するものは、8種類ある。天空には雲も含まれているので、天空の z 軸の回転やスケーリングを行うと雲の様子が変化する。sky_sphere に でpigment 文は複数記述することができるが、一番最後に記述した天空が有効となる。

 pigment { Blue_Sky } (textures.inc)
 pigment { Bright_Blue_Sky } (textures.inc)
 pigment { Blue_Sky2 } (textures.inc)
 pigment { Blue_Sky3 } (textures.inc)
 pigment { Blood_Sky } (textures.inc)
 pigment { Apocalypse } (textures.inc)
 pigment { P_Cloud2 } (skies.inc)
 pigment { P_Cloud3 } (skies.inc)

これらの天空も、前述の雲を一緒に使えるが、雲の pigment 文は天空の pigment 文より後に記述する。前に記述すると、天空は不透明なので雲が見えなくなる。

図14.8 (b) 天空 Blue_Sky と雲 Clouds

上記の図14.8(b) に、incファイルに定義されている天空 Blue_Sky と雲 Clouds を使用した例を示す。POV-Rayソースでは、他天空と他の雲はコメントアウトになっているので、コメントを変更すれば他の天空や雲を使える。これらの天空は雲も含めて定義されている。天空は同時に1つしか使えないが、雲のみ定義したものは複数使える。

//-------------------- Fig. 14.7(b) Blue_Sky + clouds #version 3.7 #include "colors.inc" #include "textures.inc" #include "stones.inc" #include "skies.inc" global_settings {assumed_gamma 2.2} camera{ location<0,-4,2.5> sky<0,0,1> right <-image_width/image_height,0,0> look_at<0,0,3> angle 60 } //-------------------------parallel light light_source {<600,-250,500> color 1.5 parallel } //================================== sky (begin) sky_sphere{ pigment{ Blue_Sky rotate x*90 rotate z*30 scale 0.8} // pigment{ Bright_Blue_Sky rotate x*90 rotate z*0 scale 1} // pigment{ Blue_Sky2 rotate x*90 rotate z*0 scale 1} // pigment{ Blue_Sky3 rotate x*90 rotate z*0 scale 1} // pigment{ Blood_Sky rotate x*90 rotate z*0 scale 1} // pigment{ Apocalypse rotate x*90 rotate z*0 scale 1} // pigment{ P_Cloud2 rotate x*90 rotate z*0 scale 1} // pigment{ P_Cloud3 rotate x*90 rotate z*0 scale 1} //--------------------inc--- pigment cloud pigment{ Clouds rotate x*90 rotate z*80 scale 0.4} // pigment{ P_Cloud1 rotate x*90 rotate z*0 scale 1} } //---------------------inc--- object-clouds // object{ O_Cloud1 rotate x*90 rotate z*60 } // object{ O_Cloud2 rotate x*90 rotate z*80 } //================================== sky (end) //-------------------------ground plane{z,0 pigment{rgb<0.75,0.8,0.5>*1.2} normal{granite 0.3 scale 10} finish{phong 1 specular 0.3} } //-------------------------- fog fog{ fog_type 2 distance 150 color White*0.7 fog_offset 0.1 fog_alt 5.0 turbulence 0.5 rotate x*90 } //---------------------------object union{ box{ 0,1 scale <2,4,2> texture {T_Grnt0 scale 2} rotate z*-50 translate <3.5,1,0> finish{ambient rgb 0.35} } box{ 0,1 scale <5,8,1> texture {T_Stone8 scale 1} rotate z*-50 translate <-2.2,1.5,0> finish{ambient rgb 0.35} } translate y*10 }

14.8 (c) 天空2

インクルードファイルにある天空で、pigment 文を使用しない天空は5種類ある。これらの天空は、sky_sphere 文の中に天空名を直接記述する。記述できるのは1つの天空だけである。これらの天空も、同様に前述の雲が併用できる。この天空にも雲も含まれているので、同様に天空の z 軸の回転やスケーリングを行うと雲の様子が変化する。

 S_Cloud1 (skies.inc)
 S_Cloud2 (skies.inc)
 S_Cloud3 (skies.inc)
 S_Cloud4 (skies.inc)
 S_Cloud5 (skies.inc)

図14.8 (c) 天空 S_Cloud1 と雲 O_Cloud1

上記の図14.8(c) に、incファイルに定義されている天空 S_Cloud1 と雲 O_Cloud1 を使用した例を示す。POV-Rayソースでは、他天空と他の雲はコメントアウトになっているので、コメントを変更すれば他の天空や雲を使える。これらの天空は雲も含めて定義されている。天空は同時に1つしか使えないが、雲のみ定義したものは複数使える。

//---------------- Fig. 14.7(c) S_Cloud1 + O_Cloud1 #version 3.7 #include "colors.inc" #include "textures.inc" #include "stones.inc" #include "skies.inc" global_settings {assumed_gamma 2.2} camera{ location<0,-4,2.5> sky<0,0,1> right <-image_width/image_height,0,0> look_at<0,0,3> angle 60 } //-------------------------parallel light light_source {<600,-250,500> color 1.5 parallel } //===================================== sky (begin) sky_sphere{ S_Cloud1 rotate x*90 rotate z*0 scale 1 // S_Cloud2 rotate x*90 rotate z*0 scale 1 // S_Cloud3 rotate x*90 rotate z*0 scale 1 // S_Cloud4 rotate x*90 rotate z*0 scale 1 // S_Cloud5 rotate x*90 rotate z*0 scale 1 //-------------------inc--- pigment cloud // pigment{ Clouds rotate z*60 scale 0.2} // pigment{ P_Cloud1 rotate z*0 scale 0.5} } //---------------------inc--- object-clouds object{ O_Cloud1 rotate x*90 rotate z*60 } // object{ O_Cloud2 rotate x*90 rotate z*80 } //==================================== sky (end) //-------------------------ground plane{z,0 pigment{rgb<0.75,0.8,0.5>*1.2} normal{granite 0.3 scale 10} finish{phong 1 specular 0.3} } //-------------------------- fog fog{ fog_type 2 distance 150 color White*0.7 fog_offset 0.1 fog_alt 5.0 turbulence 0.5 rotate x*90 } //---------------------------object union{ box{ 0,1 scale <2,4,2> texture {T_Grnt0 scale 2} rotate z*-50 translate <3.5,1,0> finish{ambient rgb 0.35} } box{ 0,1 scale <5,8,1> texture {T_Stone8 scale 1} rotate z*-50 translate <-2.2,1.5,0> finish{ambient rgb 0.35} } translate y*10 }

14.8 (d) 夜空

夜空には次のインクルードファイル文を記述する。

#include "stars.inc"

夜空が stars.inc に6種類定義されている。

 texture { Starfield1 } (stars.inc)
 texture { Starfield2 } (stars.inc)
 texture { Starfield3 } (stars.inc)
 texture { Starfield4 } (stars.inc)
 texture { Starfield5 } (stars.inc)
 texture { Starfield6 } (stars.inc)

この夜空は、球体 sphere 文で使用する。天球 sky_sphere 文では使用できない。自分たちを包む十分に大きい球を定義し、その球の内側に星空が貼り付けられる。Starfield1 から Starfield6 になるにつれて、まばらな星から満天の星がある夜空となる。

図14.8 (d) 夜空(Starfield3)

上図14.8(d) に、Starfield3 を使った例を示す。POV-Ray ソースでは、6つの sphere 文の中に天空を記述し、1つを有効にし他をコメントアウトにしているので、コメントを変更すれば他の夜空を使える。同時に使える天空は1つである。

//-------------------- Fig. 14.8(d) Starfield3 #version 3.7 #include "colors.inc" #include "textures.inc" #include "stones.inc" #include "stars.inc" global_settings {assumed_gamma 2.2} camera{ location<0,-4,2.5> sky<0,0,1> right <-image_width/image_height,0,0> look_at<0,0,3> angle 60 } //-------------------------point light light_source { <0,8,3> color 0.5 } //=================================== sky (begin) // sphere{0,1000 texture{Starfield1 scale 1000 } } // sphere{0,1000 texture{Starfield2 scale 800 } } sphere{0,1000 texture{Starfield3 scale 600 } } // sphere{0,1000 texture{Starfield4 scale 400 } } // sphere{0,1000 texture{Starfield5 scale 400 } } // sphere{0,1000 texture{Starfield6 scale 400 } } //==================================== sky (end) //-------------------------ground plane{z,0 pigment{rgb<0.75,0.8,0.5>*1.2} normal{granite 0.3 scale 10} finish{phong 1 specular 0.3} } //------------------ fog fog{ fog_type 2 distance 150 color White*0.7 fog_offset 0.1 fog_alt 1.0 turbulence 0.5 rotate x*90 } //---------------------------object union{ box{ 0,1 scale <2,4,2> texture {T_Grnt0 scale 2} rotate z*-50 translate <3.5,1,0> finish{ambient rgb 0.35} } box{ 0,1 scale <5,8,1> texture {T_Stone8 scale 1} rotate z*-50 translate <-2.2,1.5,0> finish{ambient rgb 0.35} } translate y*10 }


(End) 14.8 天空