It is very important to set the TextureAttribute to MODULATE:
here's a sample code to load the texture:

public Appearance loadTexture(javax.swing.JApplet applet, String image){
            Appearance app = new Appearance();
            java.net.URL texImage;
            Texture tex;
            Color3f white = new Color3f(1.0f,1.0f,1.0f);
            Color3f black  = new Color3f(0.0f,0.0f,0.0f);
            Color3f gray  = new Color3f(0.4f, 0.4f, 0.4f);

            texImage = applet.getClass().getResource("myimage.jpg");
            tex = new TextureLoader(texImage, applet).getTexture();

            Material mat = new Material(gray,black,white,white,128.0f);
            mat.setLightingEnable(true);

            TextureAttributes texAttr = new TextureAttributes();
            texAttr.setTextureMode(TextureAttributes.MODULATE);
            app.setTextureAttributes(texAttr);

            app.setMaterial(mat);
            app.setTexture(tex);
            return app;
}

At 13:59 25/07/00 +0200, you wrote:
>  Hello,
> I'm trying to create a box with textures on his faces and then get it
>lit. When I use the box without texture I can see the lights perfectly,
>but when I apply the texture the lights can't not be seen. Can anybody
>help?
>
> Thanks in advance
>
>  PRISMAKER TEAM
>
>===========================================================================
>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".
>

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