

import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.math.ColorRGBA;
 
/** 示例1 - 如何开始大部分简单的JME 3应用程序。
 * 展示一个蓝色的3D立方体，并且通过移动鼠标和按WASD键从各个方向
 * 观看它。*/
public class HelloJME3 extends SimpleApplication {
 
    public abstract void main(String[] args){
      HelloJME3 app = new HelloJME3();
      app.start();
    }
 
    @Override
    public void simpleInitApp() {
      Box b = new Box(Vector3f.ZERO, 1, 1, 1);
      Geometry geom = new Geometry("Box", b);
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
      mat.setColor("Color", ColorRGBA.Blue);
      geom.setMaterial(mat);
      rootNode.attachChild(geom);
    }
}