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.

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.