Reading vertices and faces from obj file, but...

Hello,

So I had to learn OpenGL for school. I’m working on my final project now, and I’m suppose to create a building. Due to the complexity of my project (it’s the dorm I live in at school), I made the model in an external editor (first TinkerCAD, then I switched to Blender to refine it) and I exported it as an .obj file.
Over the course of nearly 24 hours (with numerous late nights), I figured out how to get my program to read all of the contents of the file. However, there’s one little issue.

The vertices themselves seem to display in the correct positions (using GL_POINTS to see where they end up at), but the faces do not draw correctly… like at all. I don’t know what it is that’s causing the issue either. :tired: Does anyone think they can help me with this issue?
This is roughly what my model should look like (this is the blender object model):
[ATTACH=CONFIG]1768[/ATTACH]

This is what it looks like after I parse the .obj file in my program:
(I know the colors do not resemble my Blender model, but I haven’t figured out how to group the faces/read the diffuse color from the .mtl file (or whatever new input file I put said diffuse color values into). It’s easier for me to take this one problem at a time.)
[ATTACH=CONFIG]1769[/ATTACH]

As you can see, there are SOME shapes that seem to resemble the Blender model (at least it’s clear where the actual building is), but the way faces seem to extend and stick out nonsensically is making me think there is something wrong with the way I’m displaying them on the screen (like I’ve got some coordinates mixed up or something).
This is the component of my program which displays the faces: (faceVert1,. faceVert2, and faceVert3 are three arrays that are storing the vertices that compose the face)

for(int i = 0; i < numFaces; i++) {

  //here, the three vertices that compose a face are taken note of (saved as variables), so we can use the
  //xVert, yVert, and zVert arrays to actually draw the face. 
  vertexIndex1 = faceVert1[i];
  vertexIndex2 = faceVert2[i];
  vertexIndex3 = faceVert3[i];
     	glBegin(GL_POLYGON);
	  glVertex3f(xVert[vertexIndex1], yVert[vertexIndex1], zVert[vertexIndex1]);
	 glVertex3f(xVert[vertexIndex2], yVert[vertexIndex2], zVert[vertexIndex2]);
	  glVertex3f(xVert[vertexIndex3], yVert[vertexIndex3], zVert[vertexIndex3]);
	  glEnd();
  }

I have over 7500 faces in my program, so I cannot go back and double check to make sure every single face contains the correct vertex indices.
I mean, I don’t think anything is going wrong with the actual file reading, as the values read in for a face are correct at the beginning and at the end (I used cout to print the results to my screen so I could check to see if it was processing correctly). I have vertex normals and face normals saved in separate arrays, and I made sure to distinguish the two when my program was read.

Since I’m still new OpenGL, and I frequently miss things, I figured I should post here. I feel like whatever’s going wrong is probably something obvious, but I just can’t seem to figure it out. Please help. I need to get some actual sleep.

Are you taking into account the fact that vertex indices in an OBJ file start at one, while C array indices start at zero?

Oh! That could easily be my issue then! I’ll report back with results.

Edit: YES! That fixed it! Thank you so much! (I had a feeling my problem was something stupid like that…)