See the TextureTest/MultiTextureTest demo shipped with your java3d distribution. I do believe that every j3d programmer should have a look, at least once, on every demo in the j3d distribution.
Cheers, Florin -----Urspr�ngliche Nachricht----- Von: Lan Wu-Cavener [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 31. Januar 2003 21:06 An: [EMAIL PROTECTED] Betreff: Re: [JAVA3D] AW: [JAVA3D] AW: [JAVA3D] advice and tips on a tree At 03:42 PM 1/31/2003 +0100, you wrote: >There are several ways to use transparency. > >2. Use two textures, one greyscale specifying alpha values that you use to >create a texture in ALPHA format, and that one you combine / modulate with >the original rgb texture. In that case, both textures can be in jpg format, >first as grayscale, second as rgb. Your graphic card must support at least >two texture units. This is very new approach to me. When you load images, how can you load two images to one object? May I have a code samples? >Cheers, > >Florin > > >-----Urspr�ngliche Nachricht----- >Von: Lan Wu-Cavener [mailto:[EMAIL PROTECTED]] >Gesendet: Freitag, 31. Januar 2003 15:23 >An: [EMAIL PROTECTED] >Betreff: Re: [JAVA3D] AW: [JAVA3D] advice and tips on a tree > > >I have used gif, jpg and png. All of them are generated from Photoshop 6.0 >using transparent background and with an alpha channel added. The things >that I am not sure is when saving the image to the format mentioned above, >the alpha channel option is grayed out (deactivated). This may mean that >the alpha is taken out after saving. > >The only format that can save the alpha in PhotoShop 6 is tiff. But java3d >awt image loader does not handle this type. I have installed JAI into the >jre. I don't know how to use it into my code yet. From j3d API, it seems >that j3d would use the JAI loader automatically. But it didn't do that >here. I was wondering what type of image others use for image mapping for >objects with irregular geometry shape, such as trees, bushes. and anyone >used JAI loader could give me some help? > >Thanks! >Lan > > >At 08:28 AM 1/31/2003 +0000, you wrote: > >Did I miss something, or is this email a repost? > > > >Incidently, what format is your image? Does it actually have an Alpha > >channel? > > > >Kev > > > > > -----Urspr�ngliche Nachricht----- > > > Von: Lan Wu-Cavener [mailto:[EMAIL PROTECTED]] > > > Gesendet: Donnerstag, 30. Januar 2003 21:48 > > > An: [EMAIL PROTECTED] > > > Betreff: Re: [JAVA3D] AW: [JAVA3D] advice and tips on a tree texture > > > mapping > > > > > > > > > Thank you very much, Florin! > > > > > > I tried RGBA, and a more "full" tree image, I got the space between the > > > foliage black instead of white. Does that mean that the image > > > background part stapled to the geometry will not be transparent? > > > > > >>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. > > >>Do you mean that I need to create geometry in a similar shape as the > > >>tree shape in image? Could you please explain a little bit more? > > > > > > My geometry for the tree is editable by user which limited the degree > > > to customized the geometry to the image tree shape. > > > > > > Thanks again! > > > Lan > > > > > > > > > > > >>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". > > > > > > Lan Wu-Cavener > > > Dept. of Landscape Architecture > > > > > > > >==========================================================================T >o > > > 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". > > > > > > > >==========================================================================T >o > > > 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". > >Lan Wu-Cavener >Dept. of Landscape Architecture > >==========================================================================T o >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". 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". ==========================================================================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".
