Archived

This topic is now archived and is closed to further replies.

Gammastrahler

Problem with texture coordinates

Recommended Posts

Gammastrahler    150
hi, i have a problem, when i draw polygons, the backfacing polys have horizontal mirrored textures.... my draw code looks like this: if (backface) glFrontFace(GL_CW); else glFrontFace(GL_CCW); glBegin(GL_TRIANGLES); for (int i = 0; i < numPoints; i++) { glTexCoord2f(s, t); glVertex3f(x, y, z); } note: i set backface for each poly manually, this variable is not calculated. and here is an example how i setup my quads (build from two triangles) and texture coords: x y z s t ---------------------------- v1 = 0, 0, 0, 0, 0 v2 = 100, 0, 0, 1, 0 v3 = 0, 100, 0, 0, 1 v4 = 100, 0, 0, 1, 0 v5 = 100, 100, 0, 1, 1 v6 = 0, 100, 0, 0, 1 i hope you can help me! thanks, gammastrahler Edited by - gammastrahler on January 12, 2002 10:07:12 AM Edited by - gammastrahler on January 12, 2002 10:08:18 AM

Share this post


Link to post
Share on other sites
hooded_paladin    122
If I get what your saying, you mean when you see the back of the polygon, it is flipped left to right, so if you had some text or something assymetrical for a texture, it would look all messed up. Well, if that is what you''re talking about, I don''t think you can get around that. The texture coordinates will stay the same, so unless you program it to flip them when you''re looking at the backside it WILL get messed up. Make sure the user can''t get around to look at the backside. Draw another quad if you need to.

Share this post


Link to post
Share on other sites