Results 1 to 2 of 2

Thread: Textures and Triangle Strips - newbie question

  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    2

    Textures and Triangle Strips - newbie question

    Hello,

    Thanks in advance for putting up with what I'm afraid is a pretty simple question.

    I have a 32 by 32 vertex surface I want to use for a terrain split up as an array of triangle strips (an array of 31 vertex arrays). I want to apply a single texture to the whole collection (not once per strip). How do I do this in OpenGL ES? Or is there a simpler way to accomplish what I want (I couldn't figure out how to make one continuous strip out of them)?

    If I understand what I'm reading, glMultiDrawArrays or glMultiDrawElements would be what I need, but it appears as though they are not available in ES. (Correct?) What is the workaround?

    Thanks for any replies.

  2. #2
    Junior Member
    Join Date
    Apr 2009
    Posts
    2

    Re: Textures and Triangle Strips - newbie question

    Okay, I figured out how to link my triangle strips together using degenerate triangles as described here:

    http://www.gamedev.net/reference/articl ... le1871.asp

    and have verified that my array is arranged exactly as he describes. It LOOKS like it works, it makes the correct shape on the screen, but all I get is random pixels from the texture filling it.

    So I apparently have a basic misunderstanding of how to apply a texture to this large triangle strip, or how to treat the strip as a single object. I hoped that the clamp to edge parameter would help me, but no go. All I get is garbage. I am using the same texture coordinate array I use elsewhere with success.

    Any hints or links would be appreciated.

    Edited to add: Hmm, I think I just figured it out. The texture coordinate array needs to be the same size as the vertex array, right? I knew it was something obvious.

Similar Threads

  1. drawing triangle strips in bulk
    By Pakka in forum Developers Coding:Beginner
    Replies: 0
    Last Post: 04-19-2011, 01:33 PM
  2. Newbie question
    By lkeene in forum OpenCL
    Replies: 2
    Last Post: 07-21-2009, 11:29 AM

Posting Permissions

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