Results 1 to 3 of 3

Thread: GL_TRIANGLE_STRIPS

  1. #1
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    256

    GL_TRIANGLE_STRIPS

    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

  2. #2
    Member Contributor
    Join Date
    Apr 2000
    Location
    Hoegaarden, Belgium
    Posts
    71

    Re: GL_TRIANGLE_STRIPS

    Take a look at the nehe-tutorial about particle systems... It's explained there somewhere

  3. #3
    Member Newbie
    Join Date
    Apr 2000
    Posts
    44

    Re: GL_TRIANGLE_STRIPS

    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

Similar Threads

  1. Creating new triangles with GL_TRIANGLE_STRIPS
    By jmfurlott in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-29-2013, 05:23 PM
  2. GL_TRIANGLE_STRIPS
    By ThunderSoul in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-01-2005, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean