PDA

View Full Version : Problem with Triangle Strips



Faheem
09-09-2004, 02:10 PM
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,

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.

endash
09-09-2004, 02:50 PM
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/sw/graphics/OPENGL/gl_triangle_strip.jpg ?

Faheem
09-09-2004, 03:13 PM
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?