Including:
// Only needed at first include#defineSIMPLE_OBJ_IMP// glut needs to be included first for drawObj implementation#include<GL/glut.h>#include"simple_obj.h"Usage:
// Loading a .objSimpleObj_t*myObj=loadObj("some_model.obj");Drawing:
// GL setup stuff, transforms, ect...drawObj(myObj);
// More GL stuffGroups:
// Access the struct for the first group in the file.ObjGroup_t*group=objDataArrayAccess(&myObj->groups, 0);
// Attributes: name, startFace, endFace, & render.group->render= false; // don't draw this group.Freeing obj data:
// This obj is trashdisposeObj(myObj);
// It's where it belongs nowWorking:
- Vertices
- Normals
- Texture coords
- Faces
- Basic rendering
Todo:
Separate group rendering(done)- Materials
- Maybe support some more obj features
Clean up and free stuff(done)
