Show Posts

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.


Messages - Charles_Stain

Pages: [1]
1
Support / Re: [HOW-TO??] make reflective a simple Object3D (like a cube)
« on: October 10, 2010, 06:45:10 pm »
I think it would be a useless complication, so I'll keep the things like they are now :)
Thank for the help,
A.

2
Support / Re: [HOW-TO??] make reflective a simple Object3D (like a cube)
« on: October 10, 2010, 12:04:04 pm »
Ok, I've played a bit with the parameters of ambient and spot light and now i have a nicer effect:

The last thing I wish to know is how to get rid of the ugly look to see the light reflecting on the triangles that make the objects:

Thanks for the help :)
A.

3
Support / Re: [HOW-TO??] make reflective a simple Object3D (like a cube)
« on: October 09, 2010, 06:36:33 pm »
In first place, thank you for the quick reply.
Here is a significant code piece:

Code: [Select]
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.

4
Support / [HOW-TO??] make reflective a simple Object3D (like a cube)
« on: October 09, 2010, 05:47:16 pm »
Hello everyone,
I think that a picture worth 1000 words, so this is my situation now:



And this is what I would like to obtain (picture taken from a 3d renderer coded from my university prof.):


As you can see every edge is lit and you can recognize it.. in the first picture even if I move the camera I can't recognize a vertex from another one.
Actually I use a default global light + a simple light positioned in the same place of my camera.
I hope you have understood me :D

Have a nice day,
A.

Pages: [1]