thanks for your reply ok, it's easy with a primitive shape (sphere, cone) texture coordinates are automaticly created but how can i do that with a irregular geometry?? sorry if my question is stupid... I understand how to use the textCoordinate with a unique texture map onto a shape but not with a pattern texture and a irregular geometry? see my code below for the geometry thanks for yours advices
Regards Renaud int[] stripCount int[] indice Point3f[] pointTab GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY); gi.setCoordinates(pointTab); gi.setStripCounts(stripCount); gi.setCoordinateIndices(indice); // triangulate Triangulator tri = new Triangulator(); tri.triangulate(gi); gi.recomputeIndices(); --- Florin Herinean <[EMAIL PROTECTED]> a écrit : > 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". ___________________________________________________________ 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".