▷ 前を見る 


13.1-15 小面(facets)

facets は、法線専用のパターンでピグメントの使用には適していない。法線ベクトルをある一定範囲で固定し、それらのベクトルを変化させることで小面で構成された表面を表現する。このパターンには2つ形式、球状の物体に適している形式(size)と平面に適してる形式(coords)がある。

(上段)ノーマル (size)で使用
(下段)ノーマル (coords)で使用
図13.1-15 小面(facets)
//-------------------- Fig. 13.1-15 /facets/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== facets / normal - coords #declare T1= texture{ pigment{White} normal{ facets coords 0.8 scale 3 } } //========================== facets / normal - size #declare T2= texture{ pigment{White} normal{ facets size 0.4 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< facets の構文 >

normal { facets [ coords SCALE_VALUE | size FACTOR ] }
normal ノーマルのキーワード
coords 小面法線
SCALE_VALUE 法線の乱れ強度 (0~1)
size 小面相対サイズ
FACTOR 小面分割の程度 (0~1)

< facets >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
× color_map
× pigment_map
× texture_map
× slope_map
× normal_map
× density_map
  × 無   × 無


13.1-16 フラクタル

フラクタルパターンとしてマンデルブロ集合(mandel)とジュリア集合(julia)が使用できる。これらはフラクタルを計算して x-y 平面上に投影したパターンである。全部で4タイプのフラクタルがある。magnet は磁気現象より派生している。フラクタルのパターンは x-y 平面向きに生成される。

 (a) マンデルブロ集合1(mandel)
 (b) ジュリア集合1(julia)
 (c) マンデルブロ集合2(magnet/mandel)
 (d) ジュリア集合2(magnet/julia)

(a) マンデルブロ集合1(mandel)

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-16a mandel
//-------------------- Fig. 13.1-16a /mandel/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== mandel / pigment #declare T1= texture{ pigment { mandel 15 interior 1, 1 color_map { [0 rgb<0.8,1,0.6>*1.2] [0.3 rgb <1,0.3,0.3>] [0.4 rgb <0.3,1,0.7>] [0.9 White] } } rotate x*90 scale 0.9 } //========================== mandel / normal #declare T2= texture{ pigment{White} normal{ mandel 15, 1 interior 1, 1 rotate x*90 scale 0.9 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< mandel の構文 >

pigment { mandel ITERATIONS [, BUMP_SIZE ] [ exponent EXPONENT] [ exterior EXTERIOR_TYPE, FACTOR ] [ interior INTERIOR_TYPE, FACTOR ] }
pigment ピグメントのキーワード
mandel マンデルブロ集合の設定
ITERATIONS 繰り返し計算回数
BUMP_SIZE (ノーマルのみ)凹凸の程度 (0~1) [デフォルト:0.5 ]
exponent EXPONENT5bbb 2~33の整数値 [デフォルト:2 ]
exterior EXTERIOR_TYPE, FACTOR 表面の着色タイプ(0~6)の設定 [デフォルト:0 ]
調整値 [デフォルト:1.0 ]
interior INTERIOR_TYPE, FACTOR 内部の着色タイプ(0~6)の設定 [デフォルト:1 ]
調整値 [デフォルト:1.0 ]
  

(b) ジュリア集合1(julia)

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-16b julia
//-------------------- Fig. 13.1-16b /julia/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== julia / pigment #declare T1= texture{ pigment { julia <0.4,0.3>, 15 interior 1, 1 color_map { [0 rgb<0.8,1,0.6>*1.2] [0.3 rgb <1,0.3,0.3>] [0.4 rgb <0.3,1,0.7>] [0.9 White] } } rotate x*90 scale 0.9 } //========================== julia / normal #declare T2= texture{ pigment{White} normal{ julia <0.4,0.3>, 15, 1 interior 1, 1 rotate x*90 scale 0.9 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< julia の構文 >

pigment { julia COMPLEX, ITERATIONS [, BUMP_SIZE ] [ exponent EXPONENT] [ exterior EXTERIOR_TYPE, FACTOR ] [ interior INTERIOR_TYPE, FACTOR ] }
pigment ピグメントのキーワード
julia COMPLEX ジュリア集合の設定と、複素数の設定(2次元ベクトル)
ITERATIONS 繰り返し計算回数
BUMP_SIZE (ノーマルのみ)凹凸の程度 (0~1) [デフォルト:0.5 ]
exponent EXPONENT 2~33の整数値 [デフォルト:2 ]
exterior EXTERIOR_TYPE, FACTOR 表面の着色タイプ(0~6)の設定 [デフォルト:0 ]
調整値 [デフォルト:1.0 ]
interior INTERIOR_TYPE, FACTOR 内部の着色タイプ(0~6)の設定 [デフォルト:1 ]
調整値 [デフォルト:1.0 ]
  

(c) マンデルブロ集合2(magnet/mandel)

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-16c magnet/mandel
//--------------- Fig. 13.1-16c /magnet-mandel/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //===================== magnet-mandel / pigment #declare T1= texture{ pigment { magnet 1 mandel 15 interior 1, 1 color_map { [0 rgb<0.8,1,0.6>*1.2] [0.3 rgb <1,0.3,0.3>] [0.4 rgb <0.3,1,0.7>] [0.9 White] } } rotate x*90 scale 0.9 } //===================== magnet-mandel / normal #declare T2= texture{ pigment{White} normal{ magnet 1 mandel 15, 1 interior 1, 1 rotate x*90 scale 0.9 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< magnet/mandel の構文 >

pigment { magnet MAGNET_TYPE mandel ITERATIONS [, BUMP_SIZE ] [ exterior EXTERIOR_TYPE, FACTOR ] [ interior INTERIOR_TYPE, FACTOR ] }
pigment ピグメントのキーワード
magnet MAGNET_TYPE マグネットの設定と、タイプ(1または2)
mandel マンデルブロ集合の設定
ITERATIONS 繰り返し計算回数
BUMP_SIZE (ノーマルのみ)凹凸の程度 (0~1) [デフォルト:0.5 ]
exterior EXTERIOR_TYPE, FACTOR 表面の着色タイプ(0~6)の設定 [デフォルト:0 ]
調整値 [デフォルト:1.0 ]
interior INTERIOR_TYPE, FACTOR 内部の着色タイプ(0~6)の設定 [デフォルト:1 ]
調整値 [デフォルト:1.0 ]
   

(d) ジュリア集合2(magnet/julia)

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-16d magnet/julia
//---------------- Fig. 13.1-16d /magnet-julia/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //===================== magnet-julia / pigment #declare T1= texture{ pigment { magnet 2 julia <0.4,0.3>, 15 interior 1, 1 color_map { [0 rgb<0.8,1,0.6>*1.2] [0.3 rgb <1,0.3,0.3>] [0.4 rgb <0.3,1,0.7>] [0.9 White] } } rotate x*90 scale 0.9 } //===================== magnet-julia / normal #declare T2= texture{ pigment{White} normal{ magnet 2 julia <0.4,0.3>, 15,1 interior 1, 1 rotate x*90 scale 0.9 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< magnet/julia の構文>

pigment { magnet MAGNET_TYPE julia COMPLEX, ITERATIONS [, BUMP_SIZE ] [ exterior EXTERIOR_TYPE, FACTOR ] [ interior INTERIOR_TYPE, FACTOR ] }
pigment ピグメントのキーワード
magnet MAGNET_TYPE マグネットの設定と、タイプ(1または2)
julia COMPLEX ジュリア集合の設定と、複素数の設定(2次元ベクトル)
ITERATIONS 繰り返し計算回数
BUMP_SIZE (ノーマルのみ可)凹凸の程度 (0~1) [デフォルト:0.5 ]
exterior EXTERIOR_TYPE, FACTOR 表面の着色タイプ(0~6)の設定 [デフォルト:0 ]
調整値 [デフォルト:1.0 ]
interior INTERIOR_TYPE, FACTOR 内部の着色タイプ(0~6)の設定 [デフォルト:1 ]
調整値 [デフォルト:1.0 ]

< フラクタル >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   〇 有
  mandelのみ


13.1-17 関数(function)

関数をパターンとして利用する。POV-Ray で定義されている関数はすべて使用できる。また、自分で関数を作ることもできる。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-17 関数(function)
//-------------------- Fig. 13.1-17 /function/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== finction / pigment #declare myfnc = function { x*x - y + z*2 } #declare T1= texture { pigment { function { myfnc(x, y, z) } colour_map { [0.08 colour rgb<0.4,0.8,1> ] [0.60 colour rgb<0, 0.8, 0.5> ] [1.00 colour rgb<1, 0.7,0.4> ] } // turbulence 0.3 } } //========================== function / normal #declare T2= texture{ pigment{White} normal{ function { myfnc(x, y, z) } 0.8 //Bump_Size // turbulence 0.3 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< function >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-18 グラデーション(gradient)

gradient は滑らかに色が変化する縞のパターンである。gradient のキーワードの後にベクトルをつけて使用する。これは色が混合される方向、縞のパターンが進む方向を設定するベクトルである。

 例) pigment { gradient x } // X 方向に沿って色が変化

この例では、x=0(絶対座標)でカラーマップの最初の色が使用され、x が増加するにつれて滑らかに変化し、x=1 で終了する。そしてそれは再び最初の色から始まり、x=2 まで滑らかに変化する。x が負の値の部分ではパターンは反転する。どんなベクトルでもよいが、x,y,z が最も一般的である。

ノーマルパターンで gradient を使用すると、鋸の歯のような凹凸を生成する。ノーマルで使用するときは次のように設定する。

normal { gradient VECTOR, BUMP_FLOAT}

ここで向きを与える VECTOR は必須であるが、その後に付く凹凸の程度 BUMP_FLOAT はオプションである。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-18 グラデーション(gradient)
//-------------------- Fig. 13.1-18 /gradient/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== gradient / pigment #declare T1= texture{ pigment{ gradient x color_map{ [0.0 color rgb<0.8,0.4,0.1>] [0.9 White] } scale 0.3 } } //========================== gradient / normal #declare T2= texture{ pigment{White} normal{ gradient x, 1 scale 0.3 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< gradient >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-19 花崗岩(granite)

granite は花崗岩のパターンである。このパターンを stones.inc のカラーマップと一緒に使用すると、石のレイヤーテクスチャが作成できる。ノーマルマップで使用すると、砂利道やでこぼこの石のような凹凸となる。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-19 花崗岩(granite)
//-------------------- Fig. 13.1-19 /granite/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== granite / pigment #declare T1= texture{ pigment{ granite color_map{ [0.0 color rgb<0.8,0.6,0.5>] [0.7 White] } scale 0.6 } } //========================== granite / normal #declare T2= texture{ pigment{White} normal{ granite 0.6 scale 0.6 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< granite >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   〇 有


13.1-20 六角形(hexagon)

hexagon パターンは、3種類の六角形の棒を y 軸に平行に積み重ねたものである。3色の六角形の模様は x-z 平面に生成される。デフォルトで、ピグメントを3色(赤、緑、青)持っている。

(上段)ノーマルで使用
(下段)ピグメントのデフォルトを使用
13.1-20a 六角形(hexagon)
//-------------------- Fig. 13.1-20a /hexagon/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== hexagon / pigment #declare T1= texture{ pigment{ hexagon // <<<-----hexagon // hexagon Firebrick Orange GreenYellow scale 0.3 } } //========================== hexagon / normal #declare T2= texture{ pigment{White} normal{ hexagon 0.6 // <<<-----hexagon scale 0.3 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

hexagon パターンは、単色の代わりにピグメント文やテクスチャ文でも使用できる。次の図13.1-35b の床面に hexagon を用いてテクスチャを貼り付けた様子を示す。

図13.1-20b hexagon:texture(床面)
//-------------------- Fig. 13.1-20b /hexagon/ 2 #version 3.7 #include "colors.inc" #include "textures.inc" #include "Woods.inc" #include "stones.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, 1.2> angle 35 } light_source{ <100, -400, 500> color rgb 1.5} //================================== floor plane{ z, -1 texture { // <<<------hexagon texture hexagon texture {T_Wood19} texture {T_Wood7 } texture {T_Grnt26} scale 1.3 rotate x*90 } } //============= hexagon object #declare ColA=rgb<1,0.5,0.5>; #declare ColB=rgb<0.5,1,0.5>; #declare ColC=rgb<0.5,0.5,1>; box{-1,1 scale <2.5,1.5,0.4> pigment{ hexagon ColA ColB ColC scale 0.3 rotate x*90 } translate <0,5,0.5> }

< hexagon の構文/ピグメント>

pigment { hexagon <COLOR1>, <COLOR2>, <COLOR3> }
pigment ピグメントのキーワード
hexagon 六角形のパターンのキーワード
<COLOR1>~<COLOR3> 六角形の3色 [デフォルト:青、緑、赤]

< hexagon の構文/ノーマル>

normal { hexagon [BUMP_FLOAT] }
normal
ノーマルのキーワード
hexagon [BUMP_FLOAT]
凹凸の見かけの程度 [デフォルト:0.5 ]

< hexagon >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   〇 有
  (注:3つ設定するカラー部分にマップを設定する。)


13.1-21 イメージパターン(image_pattern)

image_pattern は画像をパターンとして利用する。イメージパターンの画像はグレースケールに変換して使用される。パターンとして使用する画像のファイルタイプと画像ァイル名を記述する必要がある。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-21a イメージパターン(image_pattern)
//------------------ Fig. 13.1-21 /image_pattern/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== image_pattern / pigment #declare T1= texture { image_pattern { png "prz-131-42-img-pt1.png" } texture_map { [0.2 pigment{rgb<1,0.3,0.0>} finish{phong 1}] [0.5 pigment{rgb<1,0.8,0.3>} finish{phong 1}] [0.8 Gold_Texture] [1.0 pigment{White} ] } scale 1 rotate x*90 } //========================== image_pattern / normal #declare T2= texture{ pigment{White} normal{ image_pattern { png "prz-131-42-img-pt1.png" } 0.6 //Bump_Size scale 1 rotate x*90 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

図13.1-21b image_pattern 使用画像

< image_pattern >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-22 豹(leopard)

leopard は丸い斑点を規則的に並べたパターンを生成する。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-22 豹(leopard)
//-------------------- Fig. 13.1-22 /leopard/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== leopard / pigment #declare T1= texture{ pigment{ leopard color_map{ [0.0 color rgb<0.7,0.7,1>] [0.5 White] } scale 0.1 } } //========================== leopard / normal #declare T2= texture{ pigment{White} normal{ leopard 1.5 scale 0.1 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< leopard >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-23 大理石(marble)

marble は、大理石模様を生成するパターンである。marble は gradient x と波形の違いだけなので非常によく似ている。このパターンは、そのまま使うと全く乱れのないパターンなので、オプションの turbulence などを併用する。下記図は、デフォルトのカラーマップで turbulence 0.8 のものである。

(上段)ノーマルで使用
(下段)ピグメントのデフォルトを使用
図13.1-23 大理石(marble)
//-------------------- Fig. 13.1-23 /marble/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== marble / pigment #declare T1= texture{ pigment{ marble // color_map{[0.0 color rgb<0.7,0.5,0.4>*1.][0.4 White]} warp { turbulence 0.8 } scale 0.5 } } //========================== marble / normal #declare T2= texture{ pigment{White} normal{ marble 0.8 warp { turbulence 0.8 } scale 0.5 } finish{phong 0.8 phong_size 200} } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< marble >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   〇 有


13.1-24 物体(object)

object パターンはオブジェクトをパターンとして処理を行う。object パターンは物体の内か外の2値になる。これはプロックパターンであるが、波形タイプ、カラーマップ、スロープマップは使用できない。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-24 物体(object)
//-------------------- Fig. 13.1-24 /object/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== object / pigment #declare T1= texture { pigment { object{ sphere{0,1} scale <0.6,1.2,1.5> color Red color White } turbulence 0.3 } } //========================== object / normal #declare T2= texture{ pigment{White} normal{ object{ sphere{0,1} scale <0.6,1.2,1.5> } turbulence 0.3 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< object の構文>

pigment { object { MY_OBJECT } LIST_ITEM_A, LIST_ITEM_B }
pigment ピグメントのキーワード
object 物体パターンのキーワード
LIST_ITEM_A 物体外部の色など
LIST_ITEM_B 物体内部の色など

< object >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave
 (変更不可)
  × 無

  (注:2つ設定するカラー部分にマップを設定する。)


13.1-25 玉ねぎ(onion)

onion は玉ねぎのように層がある同心球のパターンである。各層の厚さは1である。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-25 玉ねぎ(onion)
//-------------------- Fig. 13.1-25 /onion/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== onion / pigment #declare T1= texture{ pigment{ onion color_map{[0.0 color rgb<1,0.7,0.6>][0.6 White]} scale 0.24 } } //========================== onion / normal #declare T2= texture{ pigment{White} normal{ onion 0.6 scale 0.24 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< onion >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-26 舗装(Pavement)

単純な図形をタイルとして平面を敷き詰めるもので、タイル舗装のイメージである。この舗装として使える図形は、3角形、4角形、6角形の3つで、これらの図形を複数組み合わせて1つのタイルとして使うこともできる。また、オプションによりタイルの図形角度により、変化を与えることができる。タイル舗装は、x-z 平面に対して行われる。x-y 平面で舗装したい場合は、パターンをx軸に +90 度回転する。

(上段)ノーマルで使用
(下段)ピグメントで使用
13.1-26a 舗装(Pavement)
//-------------------- Fig. 13.1-26 /pavement/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== pavement / pigment #declare T1= texture{ pigment{ pavement number_of_sides 3 number_of_tiles 6 pattern 3 color_map{ [0.0 color rgb<1,0.5,0.2>] [0.1 color rgb<0.6,0.7,0.2>] [1 White] } scale 0.3 } } //========================== pavement / normal #declare T2= texture{ pigment{White} normal{ pavement number_of_sides 3 number_of_tiles 6 pattern 3 scale 0.3 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< Pavement の構文 >

pigment { pavement [ number_of_sides SIDES_VALUE ] [ number_of_tiles TILES_VALUE ] [ exterior EXTERIOR_VALUE ] [ interior INTERIOR_VAL ] [ form FORM_VALUE ] [ pattern PATTERN_VAL ] }
pigment ピグメントのキーワード
pavement 舗装のキーワード
number_of_sides SIDES_VALUE 図形の辺数、3,4,6より選択する。[デフォルト:3]
number_of_tiles TILES_VALUE 1つのタイルを構成する図形の数、1~6より選択する。だだし、辺数 6 場合は 最大 5 となる。[デフォルト:1]
exterior EXTERIOR_VALUE タイルの図形角度が90度以上の部分のタイル修正スイッチ、0,1,2より選択する。 [デフォルト:0]
interior INTERIOR_VAL タイルの図形凹部分のタイル修正スイッチ、0,1,2より選択する。 [デフォルト:0]
form FORM_VALUE タイルの図形角度が90度未満の部分のタイル修正スイッチ、0,1,2より選択する。 [デフォルト:0]
pattern PATTERN_VAL パターン番号、図形の辺数と数によりパターン番号数は異なる。下記の図13.1-26b 参照、 [デフォルト:1]

※ オプションの exterior, interior, form は、0のときは変化なし、1,2のときは条件にあった部分があれば修正される。

※ 図形の辺数と図形の数により生成されるパターン数は異なる。例えば、6角形の図形4つで構成されるタイルの場合、舗装のパターンは、下記の図13.1-26b の図形の辺数6と図形の数4より7種類のパターンがあることがわかる。従って、この場合は pattern に1~7の範囲で整数値を設定する。それ以外の値を設定するとエラーになる。

13.1-26b 辺数と図形数によるパターン数

< pavement >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-27 ピグメントパターン(pigment_pattern)

ピグメントをパターンとして利用する。2種類のピグメント(パターンやカラーマップなど)設定があり、それらは次のものである。
 (a) パターンとして設定するピグメント
 (b) 彩色用として設定するピグメント
ピグメントパターンは、(a) をグレースケールに変換し、それをパターンとして使用する。グレースケール (a) により (b) の強さや混合の割合を決定し、最終的な彩色が行われる。ピグメントパターンはノーマルとしても使用できる。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-27 ピグメントパターン

上図は、ピグメントパターンとしてパターン bozo を使い、ピグメントマップで、パターン cells と granite を使っている。パターン bozo に基づいてパターン cells と granite が混合されている。

//--------------- Fig. 13.1-27 /pigment_pattern/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //-------------------pigment_pattern--pigment #declare T1= texture{ pigment { pigment_pattern { //-- pigment_pattern bozo // <<<----------- bozo color_map{ [0.0 Black] [0.8 White] } scale 0.3 } pigment_map { //-- pigment_map [0, cells // <<<---------- cells color_map{ [0.0 color rgb<0.8,0.3,0.1>] [0.2 color rgb<0.3,0.4,0.8>] [1.0 color White] } scale 0.2 ] [1 granite // <<<----------- granite color_map{ [0.0 color rgb<1,0.6,0.5>] [0.7 White] } scale 0.8 ] } } } //-------------------pigment_pattern--normal #declare T2= texture{ pigment{White} normal{ pigment_pattern { bozo scale 0.3 } normal_map { [0 cells scale 0.2 ] [1 granite scale 0.8 ] } } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

< pigment_pattern >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無


13.1-28 平面(planar)

planarは, 平行な層を生成する。この層は地層や縞のように見えるが、もともとは media を想定して開発された。この層は、x-z 平面に生成され、その範囲は y=1 から-1までである。

(上段)ノーマルで使用
(下段)ピグメントで使用
図13.1-28 平面(planar)

//-------------------- Fig. 13.1-28 /planar/ #version 3.7 #include "colors.inc" #include "textures.inc" global_settings { assumed_gamma 2.2 } //========================== planar / pigment #declare T1 = texture{ pigment{ planar color_map{ [ 0 color rgb<1,1,0.5> ] [ 0.25 color rgb<1,0.7,0.2> ] [ 0.5 color rgb 1 ] [ 0.75 color rgb<1,0.5,0.5> ] [ 1 color rgb<0.5,0.5,1> ] } frequency 1 turbulence 0 } } //========================== planar / normal #declare T2= texture{ pigment{White} normal{ planar 2 frequency 2 turbulence 0 } } //--------------------------------------------- camera - light camera{ location <0,-14,8> sky <0, 0, 1> right <-image_width/image_height,0,0> look_at <0, 0, 1.2> angle 25 } light_source{ <100, -400, 500> color rgb 1.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 } } //---------------------------------sphere sphere{ 0,1 texture{T1} rotate -25*z translate -2*x} sphere{ 0,1 texture{T2} rotate -25*z translate <-2,1.3,2>} //---------------------------------Cylinder cylinder{-z,z,1 texture{T1} rotate -25*z scale 0.75} cylinder{-z,z,1 texture{T2} rotate -25*z scale 0.75 translate <0,1.3,2>} //---------------------------------Cube #declare BXA = difference{ box{-1,1} box{-1,1 translate <1,-1,1>} } object{ BXA texture{T1} rotate -25*z scale .75 translate 2*x} object{ BXA texture{T2} rotate -25*z scale .75 translate <2,1.3,2>}

テキスチャマップ、カラーマップを使用した場合、数字は小さいほどストライプの境界がはっきりする。また、均等に数字を並べることによって均等なストライプを作ることができる。

< planar >
利用可能なマッピング  デフォルトの
 波形タイプ
 デフォルトの
 カラーマップ
○ color_map
○ pigment_map
○ texture_map
○ slope_map
○ normal_map
○ density_map
 ramp_wave   × 無

 ▷ 次を見る