I would like to create lighting objects in my scene.  To do this, a BranchGroup
can be used.  It would contain a Light object (SpotLight, for example) and
a Primitive (Cone, for example).  I then add this branchgroup to the root node.
Everytime the cone's tranformation is changed, the direction of the light
should be changed as well.  However, when I add the Light object to the
branchgroup and add the branchgroup to the root node, there is no light
effect on my scene.  My code without the Primitive object is like this:

import javax.media.j3d.*;
import javax.vecmath.*;

class LightBG extends BranchGroup

{
  Vector3f Dir1 = new Vector3f(0.0f,0.0f,-1.0f);
  Color3f lColor = new Color3f(1.0f,1.0f,1.0f);
  BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
  DirectionalLight lgt1;

  public void LightBG() {
    lgt1 = new DirectionalLight(lColor,Dir1);
    lgt1.setInfluencingBounds(bounds);
    this.addChild(lgt1);
  }
}

What did I do wrong?  Is there another way to accomplish this objective?
Thanks for any answers.

-Long.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to