Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Problem with Triangle Strips

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    2

    Problem with Triangle Strips

    i just started getting into OpenGL programming, and i seem to be having a problem with my triangle stripped mesh, the whole mesh renders fine, except for the last strip or vertice going out of wack, and adding some crazy polygons. im getting the stripped vertices out of 3D studio with my own exporter, and these vertices render fine on another non-opengl based system. here is my main render loop,
    Code :
    for(i = 0; i < theObject.NumBlocks; i++){ 
     
    glBegin(GL_TRIANGLE_STRIP);
    for(j = 0; j < theObject.stripLength[i];i ++){		
     
    glNormal3f(
    theObject.theVertexList[j + offset].Normals[0],
    theObject.theVertexList[j + offset].Normals[1],
    theObject.theVertexList[j + offset].Normals[2]);
     
    glVertex3f(
    theObject.theVertexList[j +offset].Vertices[0],
    theObject.theVertexList[j + offset].Vertices[1],
    theObject.theVertexList[j + offset].Vertices[2]);
    }
    glEnd();
    offset += theObject.stripLength[i];
    }
    i know this method is slopy and slow, but its just to get the object on screen. any ideas thanks.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    Los Angeles, CA, USA
    Posts
    216

    Re: Problem with Triangle Strips

    That looks right, as long as you have the vertices in the right order. Are you using this order: http://www.york.ac.uk/services/cserv...ngle_strip.jpg ?

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    2

    Re: Problem with Triangle Strips

    im ordering in the same way 3d studio max gives the vertices to me, is it the same? i have check the help file with the sdk but it doesnt mention the strip order. anyone know this?

Posting Permissions

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