Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Texture map only part of a polygon

  1. #1
    Guest

    Texture map only part of a polygon

    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.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    St. Louis, MO USA
    Posts
    181

    Re: Texture map only part of a polygon

    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.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: Texture map only part of a polygon

    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.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Texture map only part of a polygon

    Yes, me for example, almost three years ago. http://www.opengl.org/discussion_boa...ML/000710.html

  5. #5
    Guest

    Re: Texture map only part of a polygon

    I went with the GL_CLAMP option...always seemed like kind of a stupid setting until now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •