Skip to main content
gamedev.net
🔒 Locked

distorted texture mapping

Started by timbuk2 Jan 3, 2004 at 6:28 AM 0 replies 400+ views
Original Post
timbuk2
timbuk2
I'm texture mapping a quad with an image, but if the quad is distorted the texture map goes like this, see image below: http://tim.fxhome.com/distortedTexture.jpg Is there any way to get rid of the kinks in the image and make it smooth?? I'm making my textures like this gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA8, texImage[textureID].sizeX, texImage[textureID].sizeY, GL_RGBA, GL_UNSIGNED_BYTE, texImage[textureID].data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); gluBuild2DMipmaps is used as the texture isn't of the size 2^n x 2^m and drawing the QUAD like this... glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex2f(point1x, point1y); glTexCoord2f(0.0f, 1.0f); glVertex2f(point2x, point2y); glTexCoord2f(1.0f, 1.0f); glVertex2f(point3x, point3y); glTexCoord2f(1.0f, 0.0f); glVertex2f(point4x, point4y); glEnd(); Would NURBS surfaces be the way to go?? Any advice would be gratefully received Thank you, - Tim [edited by - timbuk2 on January 3, 2004 7:37:16 AM]
blizzard999
blizzard999
Split the quad in two triangles; in your case is obvious that your QUAD has vertices on different planes.
Simply use TRIANGLE_FAN instead of QUADS...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.