2001年6月10日(日)
| #include "colors.inc" | |
| #include "shapes.inc" | |
| #include "stones.inc" | |
| background{color Black} | |
| camera{ | |
| location <0,2,-5> | |
| look_at <0,1,2> | |
| } | |
| light_source{<2,4,-3> color White} | |
| box { | |
| <-1, 0, -1>, | // 手前・下・左角 |
| < 1, 1, 3> | // 奥・上・右角 |
| texture{ | |
| T_Stone33 | // stones.incで定義済み |
| scale 4 | // 全方向を同じ量でスケーリング |
| } | |
| rotate y*20 | // "rotate <0,20,0>"と同じ |
| } |
boxは、その対角頂点の座標を指定することによって定義される。
最初のベクトルは最小の x、y、z 座標で、第2のベクトルは最大の x、y、z値でなければならない。
オブジェクトはワールド座標系の座標軸に平行に定義しなければならない。その後任意の角度で回転させることができる。
| #include "colors.inc" | |
| #include "shapes.inc" | |
| #include "stones.inc" | |
| background{color Black} | |
| camera{ | |
| location <0,2,-5> | |
| look_at <0,1,2> | |
| } | |
| light_source{<2,4,-3> color White} | |
| cone { | |
| <0, 1, 0>, 0.3 | // 一端の中心と半径 |
| <1, 2, 3>, 1.0 | // 他端の中心と半径 |
| texture{ | |
| T_Stone33 | // stones.incで定義済み |
| scale 4 | // 全方向を同じ量でスケーリング |
| } | |
| } |
コーンの形状は上面および底面の中心と半径により定義される。
この例では、一方の端が <0,1,0> で半径 0.3、他方が中心<1,2,3> 半径=1である。鋭い頂点の円錐がほしければ半径radius=0を使えばよい。
端面(end caps)は互いに平行でコーンの軸に直交している。
| #include "colors.inc" | |
| #include "shapes.inc" | |
| #include "stones.inc" | |
| background{color Black} | |
| camera{ | |
| location <0,2,-5> | |
| look_at <0,1,2> | |
| } | |
| light_source{<2,4,-3> color White} | |
| cylinder { | |
| <0, 1, 0>, | // 一端の中心 |
| <1, 2, 3>, | // 他端の中心 |
| 0.7 | // 半径 |
| open | // 端面を取り除く |
| texture{ | |
| T_Stone33 | // stones.incで定義済み |
| scale 4 | // 全方向を同じ量でスケーリング |
| } | |
| } |
円柱は、二つの端面の中心と半径により定義される。
この例では、一方の端が <0,1,0>、他方が中心<1,2,3>、半径=0.7 である。
端面(end caps)のない円柱がほしいときには、open という指定をすればよい。
| #include "colors.inc" | |
| #include "shapes.inc" | |
| #include "stones.inc" | |
| background{color Black} | |
| camera{ | |
| location <0,2,-5> | |
| look_at <0,1,2> | |
| } | |
| light_source{<2,4,-3> color White} | |
| plane { | |
| <1, 1, 0>,-0.707 | |
| pigment{ | |
| checker color Black, color White | |
| } | |
| } |
このオブジェクトは無限に続く平面である。ベクトル <1,1,0> は平面の表面法線でり、それに続く数値は原点からその法線に沿った平面の移動量である。
ここでは、平面の移動量はルート2分の1にしてあって、この平面を方程式で表せば、x+y=1となっている。
平面の上には、黒と白のチェッカー模様をいれている。
|
|||
|
|