Posts Polygon soup
Post
Cancel

Polygon soup

I have few screenshots to share today. I've managed to write OBJ file loader and very basic renderer for loaded geometry. I've also added PNG screenshots saving feature (direct copy of OpenGL front buffer) and switching between polygon drawing modes.

OBJ file loading doesn't support all the features which Wavefront format provides. Loading handles only faces with 3 vertices (no quads, but maybe I will add it when I will get some time), vertex data, UV maps and vertex normals. It also doesn't support negative/relative indexes which are present in some OBJ files. Material parsing isn't here too (well, I've needed geometry for now and I haven't got internal representation of materials in my system yet).

Additionally I've added face normals calculation for each face. If it comes about rendering it is very simple direct triangle dump smooth shaded and illuminated by one light. Final version will be using VBO's which for sure will increase framerate dramatically, maybe I will add drawing using vertex arrays for comparison.

obj loader 1 obj loader 2 obj loader 1 obj loader 2 obj loader 1 obj loader 2 obj loader 1 obj loader 2 obj loader 1 obj loader 2 obj loader 1 obj loader 2 obj loader 1 obj loader 2 obj loader 2

I've used free models from the web. Female has 8372 faces, 4235 vertices/vertex normals and 4515 UV coordinates. The second one, Suzanne monkey from Blender has 968 faces, 507 vertices/vertex normals and no UV coordinates.

This post is licensed under CC BY 4.0 by the author.