VRML ( オブジェクト )

オブジェクトの種類

VRMLで表示できるプリミティブには以下のものがある。

Cube
立方体
フィールドの種類
width value
幅 (2)
height value
高さ (2)
depth value
深さ (2)
Cone
コーン
フィールドの種類
bottomRadius value
底の半径 (1)
height value
高さ (2)
parts [SIDES|BOTTOM|ALL]
表示する面 (ALL)
Sphere

フィールドの種類
radius value
半径 (1)
Cylinder
シリンダー
フィールドの種類
radius value
半径 (1)
height value
高さ (2)
parts [SIDES|TOP|BOTTOM|ALL]
表示する面 (ALL)
AsciiText
テキスト
フィールドの種類
string "text"
表示するテキスト
spacing value
文字間の距離 (1)
justification [LEFT|CENTER|RIGHT]
文字列を原点に対して左(LEFT)、中心(CENTER)、右(RIGHT)にそろえる (LEFT)
width value
文字列の幅 (0)

  1. 以下のデータを適当なエディタで作る。
    #VRML V1.0 ascii
    Separator
    {
    	Transform
    	{
    		translation -3 0 0
    	}
    	Material
    	{
    		diffuseColor 1 0 0
    	}
    	Cube
    	{
    	}
    }
    Separator
    {
    	Transform
    	{
    		translation -1 0 0
    	}
    	Material
    	{
    		diffuseColor 0 1 0
    	}
    	Cone
    	{
    		bottomRadius 1
    		height 2
    	}
    }
    Separator
    {
    	Transform
    	{
    		translation 1 0 0
    	}
    	Material
    	{
    		diffuseColor 0 0 1
    	}
    	Sphere
    	{
    		radius 1
    	}
    }
    Separator
    {
    	Transform
    	{
    		translation 3 0 0
    	}
    	Material
    	{
    		diffuseColor 1 0 1
    	}
    	Cylinder
    	{
    		radius 1
    		height 2
    	}
    }
    Separator
    {
    	Transform
    	{
    		translation 5 0 0
    	}
    	Material
    	{
    		diffuseColor 1 1 0
    	}
    	AsciiText
    	{
    		string "TEST"
    	}
    }
    
    これを objs.wrl というファイル名でセーブする。
  2. VRML のビューワで表示する。
    例えば Netscape を使うのなら、
    # netscape objs.wrl
    

    (IRIX6.3で実行)

Prev | Next
Index | Home
abe@injapan.net