Hi Needham,
           Thanks for your prompt reply. I have followed your
suggestion(i.e., the code u have given) and I could
able to view my images.
        As u suggested me to use GIMP etc to set transparency
for my images, that will be a weird task bcos I am
using around 50 images in texture mapping.So i cannot
set transparency for each and every image.
        Actually for my program I need to set some pixels
totally transparent and some pixels semi-transparent.
I can set the Alpha values as I wish in the images.So
for displaying those images can u suggest me any
method other than the sample code u have suggested. I
am attaching my code if u wish to look at it.

Thanks in advance,
sagar.



--- Leyland Needham <[EMAIL PROTECTED]> wrote:
> Its the ZBuffer, the whole poly is still being
> rendered to the zbuffer even
> though parts of it are transparent, but there is 2
> situations (depending on
> what kind of transparency you are trying to do) with
> its own solution...
>
> What kind of transparency are you trying to do,
> blended/translucent/semi-transparency (usually water
> explosions etc), or
> cooky-cutter/sprite transparency (usually sprite
> characters etc)?
>
> I dont know the exact solution (someone here could
> probably elaborate) for
> the first situation, but you need to do ordered
> rendering, or render in
> retained mode drawing sorted polys.
>
> But It sounds like you are trying to do the
> cookycutter because you are only
> using Alpah values of 255 and 0. In which case try
> this out...
>
> Appearance app;
> app = shape.getAppearance();
>     //
> TextureAttributes texAttr;
> texAttr = new TextureAttributes();
> texAttr.setTextureMode(TextureAttributes.MODULATE);
> app.setTextureAttributes(texAttr);
>     //
> RenderingAttributes renAttr;
> renAttr = new RenderingAttributes();
>
renAttr.setAlphaTestFunction(RenderingAttributes.NOT_EQUAL);
> app.setRenderingAttributes(renAttr);
>     //
> shape.setAppearance(app);
>
> This will set a shapes texture to avoid using the
> zbuffer in areas where
> there is complete transparency, and use zbuffer
> where there is complete
> opacity.
>
> BTW, if this is what you want to do, you can set the
> transparency inside the
> gif image itself (like you would do for web
> graphics). Most modern graphics
> programs (even GIMP) will save this information for
> you if you tell it to. In
> this case you dont have to do any buffered image
> stuff, you can just load the
> texture and apply it to the appearance and do the
> above code and your set.
> Ive even gotten to the point where I load a scene
> with objects that use these
> kinds of textures and I just parse the scene
> changing all the appearances of
> the shape nodes.
>
> Leyland Needham
>
>
===========================================================================
> 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".


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

got3D.java

Reply via email to