There's something to be said for this approach - it's efficient because the data is already in the format OpenGL needs. But how did they create those header files?
Well, I don't know for sure what tool they used, but what they might have used is this Perl script written by Margeret Geroch It will take an OBJ file and convert it into a C header file that you can feed directly to OpenGL without having to do messy conversion work. For the impatient, here's a direct link to the script.
One thing this script doesn't do, however, is convert the texture coordinates, so if anybody out there knows of a similar tool that also handles texture mapping, please let me know.
I've started working on converting the normals for the OBJ loader, and hope to post it within a few days. If your models are going to be complex, you probably want to look at the header file approach, as it will probably be faster.
0 komentar:
Post a Comment