Hello. I have been programming java applications for a while, and I thought it was time to move forward towards making 3D programs and games. So I downloaded jME and installed it following the tutorial for installing jME on Netbeans. After a lot of effort I succeded, and now it runs smoothly. So I started reading a starting tutorial about jME. The first chapter worked fine, but in the second ("Hello_Node") i encountered a problem. I couldn't change the color of objects in the room. The tutorial said that the code would be:
b.setSolidColor(ColorRGBA.blue);
Now I wonder why everything I try to draw on the screen appear in a boring gray color.
Here is the link to the tutorial I am following at the moment:
http://www.jmonkeyengine.com/wiki/doku.php?id=starter:hello_node
Here is my full code:
import com.jme.app.SimpleGame;
import com.jme.bounding.BoundingBox;
import com.jme.bounding.BoundingSphere;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Node;
import com.jme.scene.shape.Box;
import com.jme.scene.shape.Sphere;
public class MainClass extends SimpleGame
{
public static void main(String[] args)
{
MainClass app=new MainClass();
app.start();
}
protected void simpleInitGame()
{
Box b=new Box("My Little Box",new Vector3f(0,0,0),new Vector3f(1,1,1));
b.setModelBound(new BoundingSphere());
b.updateModelBound();
b.setLocalTranslation(new Vector3f(0,2,0));
b.setSolidColor(ColorRGBA.red);
Sphere s=new Sphere("My Little Sphere",50,50,1f);
s.setModelBound(new BoundingBox());
s.updateModelBound();
s.setRandomColors();
Node n=new Node("My Little Node");
n.attachChild(b);
n.attachChild(s);
n.setLocalScale(5);
rootNode.attachChild(n);
}
}