I got everything to work and run in the first app. The sphere doesnt show though. It seems that the simpleInitGame() method isnt called at all. Any ideas why?
Heres the code:
import com.jme.app.SimpleGame;
import com.jme.scene.shape.Sphere;
import com.jme.bounding.BoundingBox;
import com.jme.math.Vector3f;
import com.jme.scene.state.TextureState;
import com.jme.image.Texture;
import com.jme.util.TextureManager;
public class JMonkeyEngineTest extends SimpleGame{
public static void main(String[] args) {
System.out.println("Hello Eclipse!");
JavaMonkeyEngineTest app = new JavaMonkeyEngineTest();
app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG);
System.out.println("After app.diao()");
app.start();
System.out.println("After app.start()");
}
protected void simpleInitGame() {
System.out.println("In the simple init game method");
display.setTitle("The Sphere");
Sphere s = new Sphere("Sphere", 30, 30, 25);
s.setLocalTranslation(new Vector3f(0,0,-50));
s.setModelBound(new BoundingBox());
s.updateModelBound();
Texture texture = TextureManager.loadTexture(
JMonkeyEngineTest.class.getClassLoader().getResource(
"C:/Documents and Settings/Andrew/My Documents/Graphics/Textures/GreenRedCheckersBoard.png"),
Texture.MM_LINEAR_LINEAR,
Texture.FM_LINEAR);
TextureState ts = display.getRenderer().createTextureState();
ts.setEnabled(true);
ts.setTexture(texture);
s.setRenderState(ts);
rootNode.attachChild(s);
}
}