Jasc and paintshop work in terms of layers. This means that there is no
real "image" really. Under these conditions "transparent" just means that
the paint application has nothing to show in those areas and so instead
shows their default checkerbox, etc. When paint programs go to save these
layers to an image like a BMP, JPG, PNG or GIF, the layers are flattened.
Taking into account the storage type and capabilities of the target format,
the paint programs "throw away" information. Some paint programs can convert
an area which has a transparency into a GIF correctly, by assigning one
index as the transparent index, and taking the other 255 color combiunations
and reducing the colors of the image (usually a very large number of colors)
down to 255 (plus transparent index). This usually does not go so well for
a huge number of reasons. For one thing if you have any translucent areas
this has to be resolved at the time the file is written out, which usually
results in artifacts in the resultant image. Another thing is that some GIF
writers do not translate transparent images, resulting in some default value
(like white) to be put down.
All this is the vault of the file format, not the paint program. Basically,
trying to write a layered translucent Paintshop image to a GIF file is like
trying to put a 200 pound man in pant with a 28 waist. Something has to
give.
Now Java3d does not think of transparency as off or on, but as a range.
Color in java3d can have an alpha componant. Alpha refers to a seperate
value like RGB which is used for opacity. File formats which support RGBA
work great in Java3d for this very reason. If you write out a PNG using
RGBA and load it into Java3d, it is almost perfect.
Dave Yazel
Cosm Development Team
> ----------
> From: Paraskevas Orfanides[SMTP:[EMAIL PROTECTED]]
> Reply To: Discussion list for Java 3D API
> Sent: Monday, November 20, 2000 11:22 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] java3d1.2.1beta1 - transparent gif astexture
> fails
>
> Just a little comment here. Has anybody tried working with the images and
> making sure that they are transparent, or do you just assume it because
> you
> set them up as transparent in some editor? Here is where I'm going with
> this:
> There are several web-pages that I designed. In many of them I needed an
> image with transparent areas. What I did is I used Jasc Paintshop Pro
> 6.0,
> set the background color as Transparent, deleted the areas I wanted to be
> transparent, and saved that as a gif. While in Paintshop Pro, the
> transparency worked just fine. Once I put the image on the web, all
> transparent areas simply became white! In the same manner, it could have
> become black, or whichever other color was the default for that
> application
> (which I guess is black for J3D)...
> I experimented with that and found out that if I take my gif, open it with
> Jasc Animation Shop 2.0 and do the same for a single-framed
> animation(namely set the background color to transparent and delete the
> areas), the transparency is displayed correctly. I do not know if that's
> a
> problem with photoshop as well. It's likely that it is just a bug in
> Paintshop Pro; however, you don't lose anything by trying. If you don't
> have the appropriate tools, I would be happy to do it for you, as long as
> you have a way to point to me the areas you need to be transparent. I
> only
> hope that J3D doesn't have any problems with such a gif, since it's
> supposedly an animation. But having only one frame, I think you may get
> away with it.
> There is no need to complain to the Java guys before we try all
> possibilities, right?:-)
> Paraskevas
>
> --- Tom Nelson <[EMAIL PROTECTED]> wrote:
> > My best solution is to use gif87a images with a white
> > background (black letters on white background) instead of gif89a
> > images (black letters on a transparent background), and to use the
> > 'modulate'
> > mode.
> > I change the color of the object that the gif is texured with (from dark
> > to
> > light)
> > to get the effect of 'back-lighting up' that letter of the alphabet. The
> > objects are the
> > lighted letters of the alphabet on a model of the Enigma Cipher Machine,
> > you press a key and a 'light' lights up under a letter behind the
> > keyboard.
> >
> > With all other settings the same, the transparent gif makes the object
> > 'disappear',
> > just as J. Lee Dixon indicates below that it should (it did not
> disappear
> > using
> > java3d1.2)
> > If I use a black and white gif, it works properly with java3d1.2.1b1 and
> > java3d1.2
> >
> > Using the DECAL, BLEND, or REPLACE mode did not produce acceptable
> > results,
> > although DECAL seems like it should.
> >
> > Sorry for the bandwidth, but I wanted to have _a_ solution go into the
> > archives
> >
> > in case others have a similar problem.
> >
> > Thanks for the help!
> > Tom Nelson
> >
> > "J. Lee Dixon" wrote:
> >
> > >
> > >
> > > Well, from reading some documentation about how the color (C) and the
> > > alpha (A) of a colored/textured polygon are computed:
> > >
> > > (where f=face(polygon) and t=texture)
> > >
> > > Modulate Mode:
> > > C = Cf*Ct
> > > A = Af*At
> > >
> > > In modulate mode, the alpha of the texture is *multiplied* by the
> alpha
> > > of the polygon. In other words, if you can see through the texture,
> > the
> > > poly will be invisible as well.
> > >
> > > Decal Mode:
> > > C = Cf*(1-At) + Ct*At
> > > A = Af
> > >
> > > In decal mode, the texture will blend with the poly color, but the
> > alpha
> > > will only be taken from the face. I think this may be the mode you
> > > want...
> > >
> > > (got this from the OpenGL red book...)
> > >
> > > -Lee
> > >
> >
> >
> ==========================================================================
> =
> > 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! Calendar - Get organized for the holidays!
> http://calendar.yahoo.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".
>
===========================================================================
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".