空間の視点(カメラの位置)を変更 - VRML

更新:

VRML 空間の視点(カメラの位置)を変更。

空間の視点(カメラの位置)を変更
  1. NODE
    以下のノードは、空間の視点(カメラの位置)を変更するVRMLノードです。
    #VRML V2.0 utf8
    
    Viewpoint{
      position 5 0 5
      orientation 0 1 0 0.7
      description "View1"
    }
    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. 視点
    上記のノード中にある
    Viewpoint{
    position 5 0 5
    orientation 0 1 0 0.7
    description "View1"
    }
    は視点の定義です。
    position x y z
    は視点のX、Y、Z座標の位置。
    orientation x y z rad
    は視点の中心軸の回転です。
    この例では、視点のY軸を中心に0.7ラジアン回転させています。
    description "View1"
    は視点の名前で、省略可能。
  3. NODE
    視点は複数配置することができます。
    #VRML V2.0 utf8
    
    Viewpoint{
      position 5 0 5
      orientation 0 1 0 0.7
      description "View1"
    }
    Viewpoint{
      position 0 0 5
      orientation 0 0 0 0
      description "View2"
    }
    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
        }
      }
    }
    
  4. 複数視点
    視点を表すノード
    Viewpoint{

    }
    を複数用意します。
  5. サンプル
    1. 視点
    2. 複数視点

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