package a3test.basic;

import jp.sourceforge.acerola3d.a3.*;
import javax.vecmath.*;
import jp.sourceforge.acerola3d.A23;

public class A3LookAtTest {
    public static void main(String args[]) throws Exception {
        A23.setDefaultUpperDirection(A3Object.UpperDirection.Y);
        //A23.setDefaultUpperDirection(A3Object.UpperDirection.Z);
        A3Window w = new A3Window(300,300);
        w.setCameraLocImmediately(0.0,0.5,4.0);
        //w.setCameraLocImmediately(0.0,-4.0,0.5);
        Action3D a3 = new Action3D("x-res:///vesma9.a3");
        w.add(a3);
        Vector3d v = new Vector3d();
        double t=0.0;
        while (true) {
            v.x=10.0*Math.sin(t);
            v.z=10.0*Math.cos(t);
            v.y=10.0*Math.sin(t*3.0);
            //v.x=10.0*Math.sin(t);
            //v.y=-10.0*Math.cos(t);
            //v.z=10.0*Math.sin(t*3.0);
            a3.setLookAtPoint(v);
            Thread.sleep(100);
            t = t + 0.1;
        }
    }
}
