package a3test.a3objects;

import jp.sourceforge.acerola3d.a3.*;
import java.awt.*;
import java.awt.event.*;

public class VRMLTest {
    static Frame frame;
    public static void main(String args[]) throws Exception {
        frame = new Frame("VRMLTest");
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent we) {
                frame.dispose();
                System.exit(0);
            }
        });
        A3Canvas canvas = A3Canvas.createA3Canvas(300,300);
        frame.add(canvas);
        frame.pack();
        frame.setVisible(true);

        VRML vrml = new VRML("x-res:///adviser.wrl");
        //VRML vrml = new VRML("x-rzip:x-res:///background3.a3!/background3.wrl");
        //VRML vrml = new VRML("x-rzip:x-res:///background4.a3!/background4.wrl");
        canvas.add(vrml);
        canvas.setCameraLocImmediately(0.0,0.0,5.0);
        double theta=0.0;
        while (true) {
            try{Thread.sleep(100);}catch(Exception e){;}
            vrml.setLoc(Math.cos(theta),Math.sin(theta),0.0);
            vrml.setQuat(Math.sin(theta),0.0,0.0,Math.cos(theta));
            theta = theta + 0.1;
        }
    }
}
