PDA

View Full Version : GL_TRIANGLE_STRIPS



Diapolo
05-06-2000, 06:25 AM
Hi @ll!

I always thought about how to do this with Triangle Strips, but I have no idea:

glBegin(GL_TRIANGLES);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 0.0f); glVertex3f(-0.5f, -0.5f, 0.0f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(0.5f, -0.5f, 0.0f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glVertex3f(-0.5f, 0.5f, 0.0f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(0.5f, -0.5f, 0.0f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 1.0f); glVertex3f(0.5f, 0.5f, 0.0f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glVertex3f(-0.5f, 0.5f, 0.0f);

glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 0.0f); glVertex3f(0.0f, -0.5f, 0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(0.0f, -0.5f, -0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glVertex3f(0.0f, 0.5, 0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(0.0f, -0.5f, -0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 1.0f); glVertex3f(0.0f, 0.5f, -0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glVertex3f(0.0f, 0.5, 0.5f);

glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 0.0f); glVertex3f(-0.5f, 0.0f, 0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(0.5f, 0.0f, 0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glVertex3f(-0.5f, 0.0, -0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glVertex3f(0.5f, 0.0f, 0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 1.0f); glVertex3f(0.5f, 0.0f, -0.5f);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glVertex3f(-0.5f, 0.0, -0.5f);
glEnd();

Can anyone explain to me how the Triangle Strips work? And can they be used for every geometry or only in special cases?

Diapolo

masterpoi
05-06-2000, 06:43 AM
Take a look at the nehe-tutorial about particle systems... It's explained there somewhere

Thr33d
05-06-2000, 09:14 AM
I noticed the link in opengl's programming courses and tutorials to nehe's site isn't the one it used to be. the page masterpoi is refering to is at
http://nehe.gamedev.net/opengl.asp

tutorial #19

cya

Thr33d