Presentation is loading. Please wait.

Presentation is loading. Please wait.

形状デザイン 様々な形 制御構造.

Similar presentations


Presentation on theme: "形状デザイン 様々な形 制御構造."— Presentation transcript:

1 形状デザイン 様々な形 制御構造

2 回転体

3 回転体 lathe { linear_spline
 5,<0,0>, <1,1>, <3,2>, <2,3>, <2,4>  pigment { Red }  finish { ambient .1 phong .75 } }

4 プリズム

5 prism { linear_sweep cubic_spline 0, 1, 18, <3,-5>, <3,5>, <-5,0>,      <3, -5>, <3,5>, <-5,0>, // #1 <2,-4>, <2,4>, <-4,0>,      <2,-4>, <2,4>, <-4,0>, // #2 <1,-3>, <1,3>, <-3,0>, <1, -3>,       <1,3>, <-3,0>      // #3 pigment { Green } }

6 球移動「線形」

7 球移動 #include "colors.inc" background{ color Cyan } camera{
   location <0,0,-20>   look_at <0,0,0> } light_source{ <0,0,-5> color White} sphere_sweep { linear_spline 4, <-5, -5, 0>, 1 <-5, 5, 0>, 1 < 5, -5, 0>, 1 < 5, 5, 0>, 1   pigment{ color Blue} } 指定点の 個数と 座標値

8

9 球の移動とcubic_spline #include "colors.inc" background{ color Cyan }
camera{    location <0,0,-20>   look_at <0,0,0> } light_source{ <0,0,-5> color White} sphere_sweep { cubic_spline 6, <-2, -5, 0>, 1 <-5, -5, 0>, 1 <-5, 5, 0>, 1 < 5, -5, 0>, 1 < 5, 5, 0>, 1 < 2, 5, 0>, 1 tolerance 0.1 pigment{ color Green } } 指定点の 個数と 座標値

10 球の移動とb_spline #include "colors.inc" background{ color Cyan } camera{
   location <0,0,-20>   look_at <0,0,0> } light_source{ <0,0,-5> color White} sphere_sweep { b_spline 6, <-2, -5, 0>, 1 <-5, -5, 0>, 1 <-5, 5, 0>, 1 < 5, -5, 0>, 1 < 5, 5, 0>, 1 < 2, 5, 0>, 1 tolerance 0.1 pigment{ color Green } } 指定点の 個数と 座標値

11

12

13 テキスト text { ttf "timrom.ttf" "POV-Ray 3.6" 1, 0
  translate<-3,0,0> pigment { Red } }

14 形状デザイン 今日の話題-2 変数宣言と代入計算 繰り返し構造 条件分け

15   「球」が,225個!

16 #declare , #local 識別子を宣言するために使用する #declare 識別子名 = 対象 ;
#localは宣言された場所(macroなど)でのみ有効

17 変数宣言と代入計算 変数:数値や文字列等に対して,名前をつける. 宣言:#declare Rows = 5;
    #local Here = <1,2,3>;     #declare Ao = rgb <0,0,1>; 利用:box{ Here,…. pigment{ Ao} }

18 代入と計算 #declare x=1; 変数xに1を代入する. #declare x=<式> ; 「式を計算し,その結果をxに代入する」

19 繰り返し構造 #while ( <条件> ) : #end  <条件>が「真」である間,#endまでを繰り返す.

20 ループと制御変数 #declare c=-5; #while(c<6) sphere{ <0,0,0>,0.2 translate<c,0,0> pigment{ color Red} } #declare c=c+1; #end

21 条件分け #if ( <条件> ) :    <- <条件>が真の場合 #else :    <- <条件>が偽の場合 #end

22 色分け(条件分岐の例) #declare c=-5; #while(c<6) sphere{ <0,0,0>,0.2 translate<c,0,0> #if(c<0) pigment{ color Red} #else pigment{color Green} #end } #declare c=c+1;

23 サンプルプログラムの実行結果 #declare , #while , #if , #end を使用したプログラム 10個の球を円形に並べて、
球の色を変えてみよう。

24 演習課題 球を一直線に10個並べるプログラムを作成して下さい。


Download ppt "形状デザイン 様々な形 制御構造."

Similar presentations


Ads by Google