Dr. Humberto Trejos wrote:
Thank you

Not exactly; what I want is that any black pixels within the star (a
skull in my case) stay opaque at all times, as black is needed for
proper rendering, and the remaining background to be transparent. I
don't want the background showing through the main subject of the image
(a skull floating in a room).

Humberto


Hi I *think* I get what you are saying now, I think the easiest way would be to add an alpha channel to your image and use the new image as the texture with TextureAttributes.REPLACE

HTH

Jeremy

try something like:

         Point3d[] vertecies = {new
Point3d(-width+offsetX,-height+offsetY,depth), new
Point3d(width+offsetX,-height+offsetY,depth),
            new Point3d(width+offsetX,height+offsetY,depth), new
Point3d(-width+offsetX,height+offsetY,depth)};
            plateGeom.setCoordinates(0,vertecies);
            Vector3f[] plateNormals = {new Vector3f(0f,0f,1f), new
Vector3f(0f,0f,1f),
            new Vector3f(0f,0f,1f), new Vector3f(0f,0f,1f)};
            plateGeom.setNormals(0,plateNormals);

            TexCoord2f[] plateTextCoords = {new
TexCoord2f(0f,(float)textureRatioY),
            new TexCoord2f((float)textureRatioX,(float)textureRatioY),
            new TexCoord2f((float)textureRatioX,0f),
            new TexCoord2f(0f,0f)};
            plateGeom.setTextureCoordinates(0,0,plateTextCoords);


plateShape.setGeometry(plateGeom);


            plateAppearance = new Appearance();
            transparencyAttributes = new
TransparencyAttributes(TransparencyAttributes.BLENDED, 1.0f);


TextureAttributes texAttr = new TextureAttributes(); texAttr.setTextureMode(TextureAttributes.REPLACE); texAttr.setPerspectiveCorrectionMode(TextureAttributes.FASTEST);

plateAppearance.setTexture(texture);

           RenderingAttributes plateRenderingAttributes = new RenderingAttributes();
            plateRenderingAttributes.setIgnoreVertexColors(true);

           Material plateMaterial = new Material();
            plateMaterial.setLightingEnable(false);
            plateAppearance.setMaterial(plateMaterial);

            plateAppearance.setRenderingAttributes(plateRenderingAttributes);
            plateAppearance.setTextureAttributes(texAttr);
            plateAppearance.setTransparencyAttributes( transparencyAttributes );

plateShape.setAppearance(plateAppearance);


--


Homepage: http://www.computerbooth.com/
Code page: http://www.newdawnsoftware.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