I'm not sure I totally understand the effect you are after, but I'll
take a stab.

You are making the objects totally transparent, but you want the
texture on the object to show up, and expecting the texture to be
completely opaque.

The texture REPLACE mode can be a little deceiving.  Reading from the
OpenGL "redbook", I found that for REPLACE mode the transparency of the
texture is used ONLY IF the texture is in RGBA mode.  If it is only in
RGB mode, then the transparency of the object is used.

Actually, I'm a little surprised that you see anything.  If it is using
the transparency of your object (which is set to totally transparent),
then you shouldn't see anything.

Anyway, check into the color format of your texture.  Hope this helps.

-Lee

> -----Original Message-----
> From: swkeum [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 4:40 AM
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] Object Tansparancy
>
>
> hello.
>
> i'm making transparent 3D objects in 3D space using texture .
> what i did was - set the material transparant, and set the
> texture opaque. The result was, the object is opaque to the
> background, but transparent to the other objects. the
> background is hidden behind the object, but i can see the
> other objects thru my objects.
>
> the code is like this.
>
>         TextureAttributes texAttr = new TextureAttributes();
>         texAttr.setTextureMode(TextureAttributes.REPLACE);
>         app.setTextureAttributes(texAttr);
>
>         TransparencyAttributes transparency = new
> TransparencyAttributes(TransparencyAttributes.NICEST, 1.0f);
>         app.setTransparencyAttributes(transparency);
>
>
>         Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
>         Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
>         Color3f red = new Color3f(0.7f, .15f, .15f);
>         app.setMaterial(new Material(red, black, red, black, 1.0f));
>
>
>
>             // Create a ball to demonstrate textures
>         int primflags = Primitive.GENERATE_NORMALS +
> Primitive.GENERATE_TEXTURE_COORDS;
>
>
>         Box textureCube = new Box(0.3f, 0.3f, 0.3f,primflags, app);
>         objTrans.addChild(textureCube);
>
> the same attribute is given to all of the objects.
>
> how can i hide the other object behind mine?
>
> thanks in adv. sw.
>
> ==============================================================
> =============
> 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".

Reply via email to