package a3test.motion;

import jp.sourceforge.acerola3d.a3.*;
import jp.sourceforge.acerola3d.a3.bvh.*;
import javax.media.j3d.*;
import javax.vecmath.*;

public class MarionetteCopyTest {
    public static void main(String args[]) throws Exception {
        A3Window w = new A3Window(300,300);
        Action3D a3 = new Action3D("x-res:///vesma9.a3");
        a3.setLoc(0.0,-0.5,0.0);
        BVH bvh = new BVH("x-rzip:x-res:///vesma9.a3!/Halt.bvh");
        Marionette m = new Marionette(bvh,0.0);
        //Marionette m = new Marionette();
        //m.setBVHDefaultPose(bvh);
        a3.setMotion("default",m);
        w.add(a3);
        a3.change("default");

        Transform3D t = new Transform3D();
        m.setTransform3D("face",t);
        double tt=0.0;
        while (true) {
            try{Thread.sleep(100);}catch(Exception e){;}
            tt=tt+0.1;
            Quat4d q = new Quat4d(0.0,Math.sin(tt),0.0,Math.cos(tt));
            Vector3d v = new Vector3d(0.0,5.0,0.0);
            t.set(q,v,1.0);
            //m.setTransform3D("face",t);
        }
    }
}

