?? move_in_axis_direction.java
字號:
/*
* Created on 2005-7-17
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package Move;
/**
* @author carso
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.*;
import javax.vecmath.*;
public class Move_In_Axis_direction {
public BranchGroup Move_in_direction(float startpoint,float endpoint){
BranchGroup objRoot=new BranchGroup();
BranchGroup bg_createAnim=null;
//set bounding sphere
BoundingSphere bound=new BoundingSphere(new Point3d(0.0,0.0,0.0),400.);
//create a TransformGroup
Transform3D tr1=new Transform3D();
TransformGroup trans1=new TransformGroup(tr1);
trans1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
//create a Color cube
ColorCube cube1=new ColorCube(0.5);
trans1.addChild(cube1);
//set cube1 to move
Alpha xtranAlpha = new Alpha(-1,
Alpha.DECREASING_ENABLE|Alpha.INCREASING_ENABLE,
0, 0,0, 0, 0,2000, 0, 0);
PositionInterpolator pos1=new PositionInterpolator(xtranAlpha,trans1,tr1,startpoint,endpoint);
pos1.setSchedulingBounds(bound);
trans1.addChild(pos1);
objRoot.addChild(trans1);
return objRoot;
}
public Move_In_Axis_direction()
{
System.out.println("Move_In_Axis_direction Class draw a cube and move in a direction");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -