The best way to do EXACTLY what you want is to NOT use TexCoordGeneration,
but to add the texture coordinates to the vertex definition in your
geometry.

Cheers,

Florin

-----Ursprüngliche Nachricht-----
Von: R. Carassou [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 30. Januar 2003 18:00
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] texture mapping with a pattern


Hi all,
i need some help with texture...
who can give me a good recipe (or code exemple) to add
a texture (repeat a pattern) onto a triangleArray.
see my code below

i haven't found a complete tutorial about texture, if
someone know a good link, it's would be great.

Thanks in advance
Regards
Renaud

float nb_text_x =0.03f;
float nb_text_y =0.03f;
TexCoordGeneration tcg = new
TexCoordGeneration(TexCoordGeneration.OBJECT_LINEAR
,
 TexCoordGeneration.TEXTURE_COORDINATE_2,
 new Vector4f(nb_text_x,0,0,0),
 new Vector4f(0,nb_text_y,0,0));

TextureAttributes text_att = new TextureAttributes();
text_att.setTextureMod(TextureAttributes.REPLACE);

loader = new TextureLoader(texturePath, null);
tex  = loader.getTexture();

appearance.setTexCoordGeneration(tcg);
appearance.setTextureAttributes(text_att);
appearance.setTexture(tex);

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.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".

Reply via email to