Hi…it me again
I have a bit of trouble determining a problem that im having with a Box object. I have extended the Box into Board (here is the constructor):
public Board()
{
//board = new Box("Board", new Vector3f(0f, -0.2f, 0.8f), 3.5f, 0.1f, 3.5f);
super("board");
this.setModelBound(new BoundingBox());
this.updateModelBound();
}
I have added the following instance method to Board:
public void draw(Node node, Boolean randomColor)
{
this.updateGeometry(new Vector3f(0f, -0.2f, 1.0f), 3.5f, 0.1f, 3.7f);
//board.updateGeometry(new Vector3f(0f, 0f, 0.0f), 3.5f, 0.3f, 1.5f);
if (randomColor == true)
{
this.setRandomColors();
this.setLightCombineMode(LightCombineMode.Off);
}
this.updateModelBound();
node.attachChild(this);
}
Now I call this from the BaseGame class which i have extended again (from the method initGame() ):
board.draw(rootNode, true);
cam.setLocation(new Vector3f(0f,7.3f,8f));
cam.lookAt(object.getWorldTranslation(), new Vector3f(0,1,0));
cam.update();
board.setRenderState(lightState);
board.updateRenderState();
----
The board gets rendered properly. But I see another layer of 'shading' on it which prevents the board to look fully 3D. Here is a screenshot of the problem:
http://www.mofirouz.com/jme/box.jpg
Hope someone can help me out with this one.
Thanks
Mo