For the transparency: you are striping off the alpha channel. Use
Texture.RGBA when you construct the texture.

In order to look more realistic, then you really need to have a little more
complex geometry for the "green" part, and use dot3 bump mapping for the
trunk.

Cheers,

Florin

-----Urspr�ngliche Nachricht-----
Von: Lan Wu-Cavener [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 29. Januar 2003 21:44
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] advice and tips on a tree texture mapping


Hi, everyone:

I am seeking advice despately.  I did texture mapping on a tree object
which is in a shape of two triangles (connected base to base). The
underline geometry is a TriangleStripArray. The problem is that the tree is
"Trimmed" to geometry shape. It looks very ugly. See attached picture (very
embarrassing to show). Plus, the space between the foliage is not
transparent.  I was wondering if anyone could give me some hints as how to
make the trees more realistic looking. I have played with it for couple of
days and failed to figure out what was wrong. I'd appreciate any help!
Thanks in advance!

  Here are the code that I use to set the appearance bundle.

             Texture2D treeTex = new Texture2D(Texture.BASE_LEVEL,
Texture.RGB,
                                               image.getWidth(),
image.getHeight());
             treeTex.setImage(0, image);
             treeTex.setEnable(true);
         treeTex.setBoundaryModeS(Texture.CLAMP_TO_EDGE );
         treeTex.setBoundaryModeT(Texture.CLAMP_TO_EDGE );    // get the
texture from the loader
         treeTex.setMagFilter(Texture.BASE_LEVEL_LINEAR);

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

         RenderingAttributes renderAtt =
appearance.getRenderingAttributes();
         renderAtt.setIgnoreVertexColors(true);
         appearance.setTexture(treeTex);
         appearance.setTextureAttributes(texAttr);


Lan Wu-Cavener
Dept. of Landscape Architecture

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