Collada Loader Part 1

Recently I’ve decided to use Collada as the main file format to import animated models in my simple 3D engine.
Why I decided to go with Collada? Two words: skeletal animations and tools!!!
Almost any 3D software has a Collada exporter!
The biggest problem when you have to parse Collada files, it’s how Collada organizes indices. Instead of returning a single index array, it gives you 3 different index arrays: one for vertices, one for normals and one for texture coordinates. And it’s a pain because OpenGL only accepts a single index array for all of the three!
Some people have overcome this issue by using an utility called Collada Refinery which has a “deindexer”: it takes a Collada files and it returns a new one with only one index array for vertex/normals/texture coordinates.
But because I’m a lucky guy, this utility doesn’t work on my PC πŸ˜€ So I’ve had to figure out how to reorganize indices.
Finally, last night I’ve found the solution and I was the happiest guy in the world πŸ˜€
Here’s a quick video of the loader in action, thanks for watching!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s