I already sent this to Mario, who seems to be working together with you,
since you have the same problems...It's not very good code.  I've only been
using directionalLights.  As my first time with spotLight, I thought I'd
play safe...Anyway, it works, so here it it:
private void setupLight(Color3f color)
{
        BranchGroup lightGroup = new BranchGroup();

        //construct vector pointing in the direction the camera is facing.
        Vector3f direction = new Vector3f(0,0,-1);

        // Create the bounding sphere for the light
        BoundingSphere cameraBounds = new BoundingSphere(pivot, 400.0);

        //initialize a spot light with the default values
        SpotLight light = new SpotLight();

        //set all necessary capabilities...
        light.setCapability(SpotLight.ALLOW_DIRECTION_WRITE);
        light.setCapability(SpotLight.ALLOW_CONCENTRATION_WRITE);
        light.setCapability(SpotLight.ALLOW_SPREAD_ANGLE_READ);
        light.setCapability(SpotLight.ALLOW_ATTENUATION_WRITE);
        light.setCapability(SpotLight.ALLOW_POSITION_WRITE);
        light.setInfluencingBounds(cameraBounds);

        //set the direction, attenuation, etc.
        //this could have been done by using a different constructor,
        //but I wanted to play safe...
        light.setAttenuation(.8f,0,0);
        light.setConcentration(1);
        light.setSpreadAngle(0.75f);
        light.setDirection(direction);
        light.setPosition(new Point3f());

        //add the light to a branchgroup so it can be added and
        //detached to the scene.
        lightGroup.addChild(light);

        //now it's ready to be added in the scene.
        //if root is the group it's going, this will do it:
        root.addChild(lightGroup);
}




__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

===========================================================================
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