複数の図形を配置する - VRML

更新:

VRML 複数の図形を配置する。

複数の図形を配置する
  1. NODE
    空間には、複数の物体を配置することができます。
    以下のノードは、赤色の直方体と青色の球を表示するためのVRMLノードです。
    #VRML V2.0 utf8
    
    Transform{
      translation 2 0 0
      children Shape{
        appearance Appearance{
          material Material{
            diffuseColor 1 0 0
          }
        }
        geometry Box{
          size 2 3 1
        }
      }
    }
    Transform{
      translation -2 0 0
      children Shape{
        appearance Appearance{
          material Material{
            diffuseColor 0 0 1
          }
        }
        geometry Sphere{
          radius 1
        }
      }
    }
    
  2. 物体の座標
    上記のノード中にある
    translation 2 0 0
    は、物体の座標を指定しています。
    diffuseColor x y z
    となっています。
  3. 物体の追加
    物体を表すノード
    Transform{

    }
    を繰り返し記述し、translationで座標を、geometryで物体の形を変えれば、いくつでも物体を作れます。
  4. サンプル
    1. 複数の物体

このエントリーをはてなブックマークに追加