Back of Spatial object is not rendered

Hi guys, I will just show what is happening, I don’t know how to explain it…



This is the first thing I see when running my program:

Image and video hosting by TinyPic



but when I turn the camera around to see the back of the monkey, I find out that the back of it is not being rendered:

Image and video hosting by TinyPic



here is my code:



[java]public class Jogo extends SimpleGame {



private Spatial map;



protected void simpleInitGame() {

URL folder = Jogo.class.getClassLoader().getResource(“data/”);

URL model = Jogo.class.getClassLoader().getResource(“data/macaco11.obj”);

FormatConverter converter = new ObjToJme();

converter.setProperty(“mtllib”, folder);

converter.setProperty(“texdir”, folder);



ByteArrayOutputStream BO = new ByteArrayOutputStream();

try {

converter.convert(model.openStream(), BO);

map = (Spatial) BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

map.setLocalScale(4f);



map.setModelBound(new BoundingBox());

map.setLocalTranslation(0.0f, -25.0f, -50.0f);

map.updateModelBound();

rootNode.attachChild(map);

} catch (Exception e) {

System.out.println(“Damn exceptions! O_o n” + e);

e.printStackTrace();

System.exit(0);

}

PointLight light = new PointLight();

light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 0.75f, 0.75f));

light.setAmbient(new ColorRGBA(200f, 200f, 200f, 1.0f));

light.setLocation(new Vector3f(0, 0, 0));

light.setEnabled(true);

lightState = display.getRenderer().createLightState();

lightState.setEnabled(true);

lightState.attach(light);

rootNode.setRenderState(lightState);



KeyBindingManager.getKeyBindingManager().set(“exit”, KeyInput.KEY_ESCAPE);

CameraNode camNode = new CameraNode("", cam);

camNode.setLocalTranslation(0, 1.5f, 0);



protected void simpleUpdate() {

//clear the buffer

display.getRenderer().clearBuffers();

if (KeyBindingManager.getKeyBindingManager().isValidCommand(“exit”, true)) {

System.exit(0);

}

//draw the geometry

display.getRenderer().draw(map);

//swap the buffers

display.getRenderer().displayBackBuffer();

}

}[/java]



I can’t figure out why is this happening :confused:

Ha!, I found out one thing, it is happening because of the light, when I change my PointLight location, the part which is not being rendered is the one ‘in the shadow’… In the first image I uploaded here, the light was (0;0;0) just like the camera (0;1.5; 0), so the monkey’s front was ok… Now I putted the light at (100;100;0) and that is being shown:

Image and video hosting by TinyPic



but I still don’t know why… :confused: