In first place, thank you for the quick reply.
Here is a significant code piece:
public ObjectViewer(Object3D genericShape) throws Exception {
this.world = new World();
this.world.setAmbientLight(50,50,50);
// CAMERA
this.cameraX = 50;
this.cameraY = -50;
this.cameraZ = 5;
this.cameraPositionVector = new SimpleVector(this.cameraX, this.cameraY, this.cameraZ);
// LIGHT ASSOCIATED WITH THE CAMERA
this.cameraLight = this.world.addLight(this.cameraPositionVector, 0, 0, 0);
this.genericShape = genericShape;
this.genericShape.setEnvmapped(Object3D.ENVMAP_ENABLED);
this.genericShape.build();
this.world.addObject(this.genericShape);
this.world.getCamera().setPosition(this.cameraPositionVector);
this.world.getCamera().lookAt(this.genericShape.getTransformedCenter());
}
public void loop() throws Exception {
this.buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
this.buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
this.buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
// Mouse mapper creation
[...]
// Key mapper creation
[...]
while (!org.lwjgl.opengl.Display.isCloseRequested()) {
this.buffer.clear(java.awt.Color.GRAY);
this.world.renderScene(this.buffer);
this.world.draw(this.buffer);
this.buffer.update();
this.buffer.displayGLOnly();
updateCameraWithMouse();
updateCameraWithKeyboard();
updateCameraLight();
Thread.sleep(10);
}
this.buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
this.buffer.dispose();
System.exit(0);
}
Note that the setAdditionalColor is invoked Clojure side on the Object3D genericShape passed to the class.
The important part is the first one which:
1) I set an ambientLight as the tutorials tells me to do.
2) I create and position a source of light at the same place of my camera
Cheers,
A.