package a3test.debug;

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

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

        Action3D a3_1 = Action3D.load("x-res:///axis.a3");
        a3_1.setLoc(5.0,5.0,-10.0);
        canvas.add(a3_1);
        Action3D a3_2 = Action3D.load("x-res:///axis.a3");
        a3_2.setEnableBehavior(true);
        canvas.add(a3_2);
        double theta=0.0;
        while (true) {
            try{Thread.sleep(100);}catch(Exception e){;}
            a3_2.setLoc(Math.cos(theta),Math.sin(theta),0.0);
            canvas.setCameraLoc(Math.cos(theta),Math.sin(theta),5.0);
            theta = theta + 0.1;
        }
    }
}
