Hi Ben,

I checked my applications, and it looks like you made all the required
settings. Still, in my case it works. So, the only thing I noticed you
didn't use is Mser.setLightingEnable(true);

Dirk

----- Original Message -----
From: "Ben Moxon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 08, 2003 5:02 PM
Subject: [JAVA3D] Simple problem with appearance and textureattributes


I have a stupid problem here that I just can't remember how to get around.

I have my code to apply an appearance to a shape3d, like this:

============================================================================
======
Appearance aper = new Appearance();
Color3f Black = new Color3f(0f, 0f, 0f);
Color3f White = new Color3f(1.0f, 1.0f, 1.0f);
 javax.media.j3d.Material Mser = new javax.media.j3d.Material(White, Black,
White, White, 0.2f);
aper.setMaterial(Mser);
TextureAttributes texatt=new TextureAttributes(TextureAttributes.BLEND, new
Transform3D(), new Color4f(1f, 1f, 1f, 1f), TextureAttributes.NICEST);
aper.setTextureAttributes(texatt);
this.setAppearance(aper);
============================================================================
=======

Nothing wrong there, except that when my scene is unlit, the shape is still
visible. After asking around I figured that it may be the fact I am using
BLEND and perhaps the ambient colour settings that are causing this, so I
change it around:

============================================================================
======
Appearance aper = new Appearance();
Color3f Black = new Color3f(0f, 0f, 0f);
Color3f White = new Color3f(1.0f, 1.0f, 1.0f);
 javax.media.j3d.Material Mser = new javax.media.j3d.Material(Black, Black,
White, White, 0.2f);
aper.setMaterial(Mser);
TextureAttributes texatt=new TextureAttributes(TextureAttributes.MODULATE,
new Transform3D(), new Color4f(1f, 1f, 1f, 1f), TextureAttributes.NICEST);
aper.setTextureAttributes(texatt);
this.setAppearance(aper);
============================================================================
=======

But now my shape looks black - it is still reflecting the lights but it is
reflecting them as a plain black surface with no visible texture.

I tried adjusting the texture blend colour and the ambient colour of the
Material but none of it seems to be making any difference. I know the lights
are in bounds because they are affecting other objects in the scene.

I'm sure I'm missing something obvious, but I just can't see what!

-ben

Ben Moxon
newview*

t: 01483 685 398
e: [EMAIL PROTECTED]
w:http://www.newview.co.uk/
****************************************************************************
*****
This email, its content and any files transmitted with it are intended
solely for the addressee(s) and may be legally privileged and/or
confidential. If you are not the intended recipient please delete and
contact the sender via email return. Unless expressly stated otherwise,
and subject to the disclaimer below, this email does not form part of a
legally binding contract or agreement between the recipient and
Newview Communications Limited.
Messages sent via this medium may be subject to delays, non-delivery
and unauthorised alteration. This email has been prepared using
information believed by the author to be reliable and accurate, but
Newview Communications Limited makes no warranty as to accuracy or
completeness.
In particular, Newview Communications Limited does not accept
responsibility for changes made to this email after it was sent.
Any opinions or recommendations expressed herein are solely those
of the author. They may be subject to change without notice.
****************************************************************************
*****

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