I have a Vertex data type which includes position (3), texture (2), and vertex normal (3). I'm passing these to a vertex shader using glVertexAttribPointer
(see here).
Unfortunately, no matter what model I loaded in, it gave me the Death Star — basically a sphere of vertices which is only visible when I switch to wireframe rendering.
I tried deleting a bunch of vertices from my module, and eventually arrived at a partially constructed Death Star. At this point it became clear that it was plotting normals as if they were vertices. I don't know that the vertices are being plotted at all.
I confirmed my hypothesis by drawing two additional triangles — one to represent where vertices should be and the other to represent the normals. I also scaled them by 1.1 so they would be distinguishable from the object itself. And yes, it's definitely drawing normals instead of vertices.
Does anyone have any idea why? I've tried switching the order of the attributes in the shaders, but that didn't help (oddly).
Here's the complete minimum working example along with the two test objects (complete, n20r4_d5.obj; and very partial, test11.obj).