色・材質の定義

5. transparency(透過)


transparency は、透過を表す単語です。
放射は、照明のように光を放つことです。
transparency の後に { } をつけて、その中に
0.0から1.0の間の値を1個書いて、透過の割合を表します。


以下、黄色い大きな球の奥に、
赤い円すいが透けて見えるシーンの記述例です。
transparency の値に着目してください。

#VRML V2.0 utf8

Transform {
  translation 0.0 0.0 -3.0 
  children [
    Shape {
      appearance Appearance {
        material Material {
          diffuseColor 1.0 0.0 0.0
        }
      }
      geometry Cone {
        height 3.0
        bottomRadius 2.0
      }
    }
  ]
}

Transform {
  translation 0.0 0.0 3.0 
  children [
    Shape {
     appearance Appearance {
      material Material {
       diffuseColor 1.0 1.0 0.0
       transparency 0.5
      }
     }
     geometry Sphere {
      radius 2.0
     }
    }
  ]
}

上の VRML を実際に表示してみましょう。


目次に戻る