Hi Florin!
> I've tried to use the dot3 bump mapping code
from Alessandro Borges (a big
> THANK YOU!).
> THANK YOU!).
You are welcome ;)
About lighting & Dot3 read Artur
Biesiadowski post (21/Jan/2003) as well some Justin points on
"Dot3,VertexColor...&madness" (21/Jan/2003). Very useful info.
a resume, as I understand :
The lighting is provided by the Dot3!
Alessandro
----- Original Message -----
From: "Florin Herinean" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 8:48 AM
Subject: [JAVA3D] DOT3 Bump
Mapping
>
> I've tried to use the dot3 bump mapping code from Alessandro Borges (a big
> THANK YOU!). After some small code corrections, I managed to get very nice
> bumps on my planets :-) However, there is still something that bothers me.
> When applying bump mappings, the ambient light is *completely* disabled. The
> only lights still in action are the point or directional lights. Is there
> anything wrong I'm making in the following code that have the net result of
> disabling the ambient light ?
>
> javax.media.j3d.Texture tex = ResourceManager.loadTexture(getTextureURI());
> javax.media.j3d.Texture bump = ResourceManager.loadTexture(getBumpURI());
>
> TextureUnitState[] tus = new TextureUnitState[2];
>
> TextureAttributes tb = new TextureAttributes();
> tb.setTextureMode(TextureAttributes.COMBINE);
> tb.setCombineRgbMode(TextureAttributes.COMBINE_DOT3);
> tb.setCombineRgbScale(2);
>
> tb.setCombineRgbFunction(0,TextureAttributes.COMBINE_SRC_COLOR);
> tb.setCombineRgbFunction(1,TextureAttributes.COMBINE_SRC_COLOR);
> tb.setCombineRgbFunction(2,TextureAttributes.COMBINE_SRC_COLOR);
>
> tb.setCombineRgbSource(0,TextureAttributes.COMBINE_TEXTURE_COLOR);
> tb.setCombineRgbSource(1,TextureAttributes.COMBINE_PREVIOUS_TEXTURE_UNIT_STA
> TE);
> tb.setCombineRgbSource(2,TextureAttributes.COMBINE_OBJECT_COLOR);
>
> TextureAttributes tt = new TextureAttributes();
> tt.setTextureMode(TextureAttributes.MODULATE);
>
> tus[1] = new TextureUnitState(tex, tt, null);
> tus[0] = new TextureUnitState(bump, tb, null);
> app.setTextureUnitState(tus);
>
> Thanks for any help,
>
> Florin
>
> ===========================================================================
> 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".