I think it would be a useless complication, so I'll keep the things like they are now
Thank for the help,
A.
Thank for the help,
A.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
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);
}
Page created in 0.020 seconds with 12 queries.