package a3test.etc;

import jp.sourceforge.acerola3d.a3.*;

public class InterpolateRatioTest {
    public static void main(String args[]) throws Exception {
        A3Window w = new A3Window(300,300);
        Action3D a3 = new Action3D("x-res:///axis.a3");
        a3.setScaleImmediately(0.3);
        a3.setLocImmediately(1.0,0.0,0.0);
        a3.setEnableBehavior(true);
        w.add(a3);
        double ir = 0.5;
        for (int i=0;i<10;i++) {
            System.out.println("ir:"+ir);
            a3.setInterpolateRatio(ir);
            a3.setLoc(-1.0,0.0,0.0);
            Thread.sleep(1000);
            a3.setLoc(+1.0,0.0,0.0);
            Thread.sleep(1000);
            ir = ir * 0.5;
        }
        ir = 0.5;
        a3.setLocImmediately(0.0,0.0,0.0);
        for (int i=0;i<10;i++) {
            System.out.println("ir:"+ir);
            w.setCameraInterpolateRatio(ir);
            w.setCameraLoc(0.0,0.0,10.0);
            Thread.sleep(1000);
            w.setCameraLoc(0.0,0.0,1.0);
            Thread.sleep(1000);
            ir = ir * 0.5;
        }
    }
}
