I can't find direct light, it is not be supported?

Started by nill, November 03, 2016, 05:25:08 PM

Previous topic - Next topic

nill

if i set up an ambient light, the scene looks like this:  the surface of the cube all are brightness , see attachment bad.png
i want it looks like good.png , but i can't find direct light to implement that effect.

help me out pls

EgonOlsen

#1
There's a Light class for lights. Just turn down the ambient light and place a light source in front of the cube. Depending on the object, that might still not create such sharp edges. If that's an issue, post again.

nill

I turn down the ambiant light of the world, and setup a light (seems a  spot light).
here are the code:

world.setAmbientLight(1, 1, 1);

Light light = new Light(world);
light.setIntensity(128, 128, 128);
light.setAttenuation(800);
light.setPosition(new SimpleVector(-100, 0, 100));

obj.setAdditionalColor(Color.blue);
world.addObject(obj);

is better ,but the sharp edges still not show up. :(

MichaelJPCT

i think the Light in JPCT is omni light (light ball, all directional).
if you want to simulate sunlight shining on earth, place a light 100000 units away, and make its intensity not fade.
if you want multiple lights with multiple directions in one scene, i don't know how.