?? animation.java
字號:
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;
public class Animation{
public Animation()
{
SimpleUniverse su=new SimpleUniverse();
BranchGroup bg=new BranchGroup();
TransformGroup tg=new TransformGroup();
bg.addChild(tg);
ColorCube cc=new ColorCube(0.3);
tg.addChild(cc);
tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
Alpha a=new Alpha(-1,2000);
Transform3D tf=new Transform3D();
// tf.rotZ(-Math.PI/10);
tf.rotX(0);
RotationInterpolator ri=new RotationInterpolator(a,tg,tf,0f,(float)(2*Math.PI));
BoundingSphere bs=new BoundingSphere();
ri.setSchedulingBounds(bs);
tg.addChild(ri);
su.getViewingPlatform().setNominalViewingTransform();
su.addBranchGraph(bg);
}
public static void main(String[ ] args)
{
new Animation();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -