|
The PointLight is the conceptual opposite of a DirectionalLight. It is an omni-directional
light source whose intensity attenuates with distance and has location. (A DirectionalLight
source has no location, just a direction.) PointLight objects approximate bare light bulbs,
candles, or other light sources without reflectors or lenses.
public class PointLightExample extends JFrame{
//Define the PointLight object
private PointLight light=new PointLight();
...
BranchGroup createScene() {
BranchGroup scene=new BranchGroup();
scene.addChild(new Sphere(0.4f));
// Config the light
light.setCapability(PointLight.ALLOW_POSITION_WRITE);
light.setColor(new Color3f(Color.RED));
light.setPosition(0.0f,1.0f,0.0f);
light.setInfluencingBounds(new BoundingSphere());
// Add the light
scene.addChild(light);
scene.compile();
return scene;
}
...
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.