2011年9月12日月曜日

Sterling2 立体物に貼り付ける

XaoSでも立体物に貼り付けたものを紹介したが、改めて貼り付け方等を紹介する。
立体物の作成とレンダリングは、POV-RAYを使うのが最も簡単と思われる。
それには、POV-RAYのInsert Menuを使えるようにしておくことが肝心である。
POV-RAY:
http://www.povray.org/download/
Insert Menu:
http://www.f-lohmueller.de/pov_tut/down/insert_a.htm
Basic_Templates:
http://www.f-lohmueller.de/pov_tut/addon/00_Basic_Templates/_index.htm

これらの使い方、解説は数多くWebに載っている。
これらが、使えれば好きな立体物を作ってそれに貼り付けて楽しむことができる。
ちなみに、Insert Menuは、通常¥マイドキュメント¥POV-Ray¥v.3.6またはv3.7のフォルダー内に形成される。

サンプル作成方法:
1.貼り付けるSterling2の画像2枚を1つのフォルダーを作って入れる。
001.png(Parameter file : 001.loo )


001_7.png(Parameter file : 001_7.loo)

2.POV-RAYの「Insert」から「Ready_made_scenes\Basic_Scene_01-Checkered plane」を選択する。


今回は、煩雑さを避けるためにチェッカーフロアー(// ground ----- plane{ <0,1,0>, 0 ・・・・)を削除し、トーラス「Insert¥Basic_shapes\torus」を追加した。

1で作ったフォルダー内にプログラムを保存する。レンダリングすると、このような画像になる。(Program file : wrap.pov)

下記に、Parameter file : 001.loo、Parameter file : 001_7.loo、Program file : wrap.pov を添付する。

//----------001.loo

Sterling-Ware v1.7
18
1
0
fractal formula
render formula
reservedtitle
2.39763009473716
-1.59729031974726
-0.438738888533976
-9.28599339044445
-8.63430821038698
115
215
107
1.34
1.76
2.16
1
10
9
6
0.36
1
1
200
4
0
0
0
0
0
1
127
127
127
127
127
127
1
1
0

//--------------001_7.loo
Sterling-Ware v1.7
41
1
0
fractal formula
render formula
reservedtitle
2.76056353269617
0.0297294804425227
1.03596525255127
0.907958183432476
1.47396580524364
115
215
107
1.34
1.76
2.16
1
10
9
6
0.36
1
1
200
4
0
0
0
0
0
1
127
127
127
127
127
127
1
1
0

//--------------wrap.pov


// PoVRay 3.7 Scene File " ... .pov"
//Example file (wrap.pov):
// date:    ...
//--------------------------------------------------------------------------
#version 3.7;
global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 }}
//--------------------------------------------------------------------------
#include "colors.inc"
#include "textures.inc"
#include "glass.inc"
#include "metals.inc"
#include "golds.inc"
#include "stones.inc"
#include "woods.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "functions.inc"
#include "math.inc"
#include "transforms.inc"
//--------------------------------------------------------------------------
// camera ------------------------------------------------------------------
#declare Camera_0 = camera {perspective angle 70               // front view
                            location  <0.0 , 1.0 ,-3.0>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1 , 0.0>}
#declare Camera_1 = camera {/*ultra_wide_angle*/ angle 90   // diagonal view
                            location  <2.0 , 2.5 ,-3.0>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
#declare Camera_2 = camera {/*ultra_wide_angle*/ angle 90  //right side view
                            location  <3.0 , 1.0 , 0.0>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
#declare Camera_3 = camera {/*ultra_wide_angle*/ angle 90        // top view
                            location  <0.0 , 3.0 ,-0.001>
                            right     x*image_width/image_height
                            look_at   <0.0 , 1.0 , 0.0>}
camera{Camera_0}
// sun ----------------------------------------------------------------------
light_source{< 3000,3000,-3000> color White}
// sky ----------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
                       color_map { [0.00 rgb <0.6,0.7,1.0>]
                                   [0.35 rgb <0.1,0.0,0.8>]
                                   [0.65 rgb <0.1,0.0,0.8>]
                                   [1.00 rgb <0.6,0.7,1.0>]
                                 }
                       scale 2        
                     } // end of pigment
           } //end of skysphere
//---------------------------------------------------------------------------
//  sphere
sphere { <0,0,0>, 1.00
        texture {
            pigment{
              image_map {
                png "001.png"
                map_type 1
                        }
                  }
              rotate <30,90,0>
              finish { specular 0.4 phong 0.3 ambient .6}
            } // end of texture  
         //texture { Polished_Chrome
                   //pigment{ color Red } // rgb< 1, 0.0, 0.0>}
                   //finish { phong 1 reflection {0.40 metallic 0.5}}
                // } // end of texture

          scale<1,1,1>  rotate<-10,-80,0>  translate<0,1.35,0>
       }  // end of sphere -----------------------------------

//---------------------------------------------------------------------------
torus { 1.0,0.25  rotate<0,0,0>
        texture {
            pigment{
              image_map {
                png "001_7.png"
                map_type 5
                        }
                  }
              rotate <90,90,-40>
              finish { specular 0.4 phong 0.3 ambient .6}
            } // end of texture
        scale <1,1,1>*1.4 rotate<0,0,0> translate<0,0.25,0>
      } // end of torus  -------------------------------            

0 件のコメント:

コメントを投稿