Drawing Faces from 3DS file

So I just implemented the ability to load vertices and faces from a 3DS file, and it mostly works, with one aspect that has me scratching my head. I am using the following loop to draw the faces after loading a model. The issue is that the model seems to display numerous extra edges when viewing in a wireframe mode. I have checked multiple models and have seen this throughout, I am wondering if anyone has any suggestions on how to fix my problem.


	glBegin(GL_TRIANGLES);
	for(int x = 1; x < 4*numberOfTriangles+1; x++)
	{
		//Face bit modifiers not needed, skip em.
		if(tLoop == 4)
		{
			tLoop = 0;
			continue;
		}
		else
		{
			glVertex3f(Vertices[Triangles[x]*3],Vertices[(Triangles[x]*3)+1],Vertices[(Triangles[x]*3)+2]);
			tLoop++;
		}
	}
	glEnd();

And the following is an example of what I am asking about.

I don’t think your loop looks right. Doesn’t x have to increase by 3 on each iteration?

If I was drawing 3 vertices per loop it would, but I’m only drawing a single vertex per loop.

Figured out my own problem. Notice how the begin and end blocks appear outside of the loop. The program was trying to draw triangles using every vertex in the mesh, one after another. Thus it kinda created one giant mess. I changed to placing three vertices at a time(one face), and I placed the begin/end blocks inside the loop, and changed the loop to increment by 4 each time, allowing me to skip the face data.

Just in case anyone was curious.