当前位置: 代码迷 >> 其他开发语言 >> 关于vrml语言,用applet,兑现添加与删除节点,运行不了
  详细解决方案

关于vrml语言,用applet,兑现添加与删除节点,运行不了

热度:7268   发布时间:2013-02-26 00:00:00.0
关于vrml语言,用applet,实现添加与删除节点,运行不了
运行vrml与java交互,需要配置环境,还要相应的包,这里有没会的人,帮小弟看一下,非常谢谢。
vrml代码:
#VRML V2.0 utf8
Viewpoint
{
        position 0 0 15
        orientation        0 0 1 0
        fieldOfView         0.8
}
Background
{
        skyColor [ 0 0 0.2,
                0.1 0.1 0.8,
                0.7 0.8 0.9
        ]
        skyAngle [1 1.57 ]
        groundColor        [ 0 0 0,
                0.5 0.4 0.3,
                0.3 0.3 0.3
        ]
        groundAngle        [1 1.57]
}

DEF        Base Transform {
        translation         -5 0 0
        
        }



}
DEF        Base1 Transform {
        translation         -2 0 0
                
        
}
DEF        Base2 Transform {
        translation         1 0 0
        
}
DEF        Base3 Transform {
        translation         4 0 0
        
}







java代码:
import java.awt.*;
import java.applet.*;
import java.lang.*;
import vrml.external.*;
import vrml.external.field.*;
public class AddRemove extends Applet
{
        Browser browser = null;
        Node theBase = null;
        Node theBase1 = null;
        Node theBase2 = null;
        Node theBase3 = null;
        Node[] shape;
        Node[] cone;
        Node[] box;
        Node[] cylinder;        
        EventInMFNode addChildren;