Issues with culling and triangle strips

Hi all,

my first post here so please be gentle if did something stupid :wink:

I’m trying to switch the rendering of a tube from using triangles to using triangle strips. Everything looks fine (shading, different materials for front/back faces)… but the culling isn’t working. Independent of the current faces to be culled, all faces get rendered.

Does anybody has an idea what I missed here?

Thanks,

Hurzelchen

glEnable(GL_CULL_FACE) missing?

Also you will better use indexed array (array buffer + element buffer) instead of triangle strip. It’s more efficient in general, less vertex duplication, possible better vertex caching.

Then it wouldn’t work when using triangles… As I said I only changed the rendering from using GL_TRIANGLES to GL_TRIANGLE_STRIP (and the corresponding vertex calls).

Then it means you did not converted correctly the vertex order.
So some of your triangles are CW instead of CCW and get culled when visible.

Ouch… found my mistake… Called glBegin(GL_TRIANGLE_STRIP) and glEnd() only once instead of calling it for every strip…

Thanks for making me think again :wink:

Now i just have to find the reason why my normals are calculated that strange… but that’s another story…

if you have several substrips, you can use GL_NV_primitive_restart extension. By the way, it looks that this extension is specially mentioned in 3.1 spec.