PDA

View Full Version : Texture map only part of a polygon



04-11-2003, 09:10 AM
Is there a way to apply a texture map to only part of a polygon? For example, I have some quadrilateral of irregular shape. I want to texture a rectangle onto it in just one place, without distorting the texture at all. I could probably create another quad that's the same size as the texture, and then try to line it up with the original polygon, but it seems like sort of a kluge solution.

ioquan
04-13-2003, 05:27 PM
There is no way in opengl to texture map only part of a polygon. One alternative is, like you said, to use a seperate polygon for the part you need texture mapped.

Deiussum
04-14-2003, 04:45 AM
I thought I remember someone discussing a way to do this awhile ago.

Anyway, I believe it could be done by using the appropriate texture coordinates with non-repeating textures, and having an alpha around the border to remove with alpha blending or an alpha test.

Relic
04-14-2003, 06:46 AM
Yes, me for example, almost three years ago. http://www.opengl.org/discussion_boards/ubb/wink.gif http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/000710.html

04-14-2003, 11:08 AM
I went with the GL_CLAMP option...always seemed like kind of a stupid setting until now.