AshChlor
AshChlor

Reputation: 139

opengl Obj model loading

I'm trying to load an Obj file into my scene. I used an online tutorial.

I took the entire Model_OBJ class as it is without changing it but for some reason when I try to draw the model this is what I get. I also tried taking the Display function and the initialize function so it should have been almost entirely the same..

Does anyone have any thought as to why it comes out like this? I'd paste my code but it really is just a copy of the website's Model_OBJ class

Cessna model

Upvotes: 0

Views: 1692

Answers (2)

AshChlor
AshChlor

Reputation: 139

So apparently my problem was that I didn't triangulate the obj. Downloaded Blender and triangulated and now it works.

Thanks everyone

Upvotes: -1

datenwolf
datenwolf

Reputation: 162164

Looks like inconsistend face winding across the mesh. When drawing the primitives in a mesh it is expected that for all the front facing faces, when projected onto the screen all the vertices of each primitive end up in either clockwise or counterclockwise order for all vertices. Your model looks like there is no consistency in the winding order.

Upvotes: 1

Related Questions