import com.sun.j3d.utils.geometry.*; import javax.media.j3d.*; import javax.vecmath.*; /** * Adds a PointLight to the scene graph */ public class PointLightBranch extends TransformGroup { BoundingSphere bounds = new BoundingSphere(new Point3d(), 10.0); Vector3f direction = new Vector3f(0.0f, -1.0f, 0.0f); Point3f position = new Point3f(0.0f, 0.0f, 0.5f); Color3f white = new Color3f(1.0f, 1.0f, 1.0f); Color3f red = new Color3f(1.0f, 0.0f, 0.0f); Color3f green = new Color3f(0.0f, 1.0f, 0.0f); Color3f blue = new Color3f(0.0f, 0.0f, 1.0f); public PointLightBranch() { PointLight lightP = new PointLight(); lightP.setInfluencingBounds(bounds); lightP.setCapability(Light.ALLOW_INFLUENCING_BOUNDS_READ); lightP.setPosition(position); lightP.setColor(green); addChild(lightP); } } // PointLightBranch