Displaying dae files in openGL

I have been playing around setting up my 3d game in openGL. I am at the point where I want to display 3d models. I was recommended to render .dae files. Am not sure, how to go about this…

I have been reading for sometime (mainly the specification) about dae files and I understand they are xml files. I also understand some of the concepts about data sink and data source, how data is organized in meshes, etc. But, am not sure how to proceed.

From what I understand, I need to parse the xml and store vertices/triangles in my own structures and feed openGL the same to render the model. Am I correct?

Can someone please point me in the right direction…

Also, is there a library available which parses the xml for me and returns all the triangles / geometry? If so, I can then work on translating them data structures to something that openGL would understand.

I would appreciate any help.
Thanks

Have you looked at GLC_Player?

I just did…but I want to be able to load in dae models in my game. I don’t think they provide a library which would load the dae files in some sort of a data structure which is available to me ?

Also, do you know of any library that does that ?

Every game (application) engine has its own data model. That’s one of the reasons why COLLADA was designed as an intermediate language that everyone could use. There are plenty of open source projects (see the Products Portal) that will help you write an importer for your game engine or OpenGL. Probably the most active library style project is OpenCOLLADA.

I also want to use Collada with OpenGL but I am trying to do this on Ubuntu. I downloaded the DOM and I tried to get the viewer to work however the includes and paths are a mess.

I also tried the demo program on codeProject but it is windows dependent(as fas as I could tell).

I checked out the GLC_Player but I do not want to use quicktime.

Why is it that dae is so complicated to implement in a OpenGL non windows game? I had obj working but I need animations and md2 doesn’t let me use bones.

What is the best way besides making my own loader to get a dae file to work?

Thanks!

Well, I can say that I was in the same boat sometime back. But, spending sometime reading about collada, I quickly realised its organised in a very logical manner. And, the dom makes it so easy to access the data! Anyways…

I do not know of a library, but I can possibly help you with getting started for writing a loader for .dae files. Also, take a look at this tutorial

I use the following combo:

  • C++ / openGL
  • colladaDom for parsing all the dae files
  • Qt for window management.

(PS: I am not sure if dom 1.4 supports animations yet. I might be totally wrong, but I read that somewhere. Or, it maybe the new physics module they have…look it up before you dive into using colladaDom)

I have surfed for hours today for Callada info and OpenGL. I was hoping to use existing code because I only have a month to build a game for school.

If you don’t mind assisting me then I suppose it would be good for me to learn from “step by step how to read Geometry, Skeleton and Animation Data from COLLADA documents” tutorial you posted. I had found this page but i only skimmed it.

The main reason I am choosing Collada is because of the animation data. It seems though that Collada is used on PS3 which I thought was cool.

I am going to try to use the DOM stuff again but it is a big mess and I’m not sure what all I need from it.

Thanks for any help!

I know how that feels! Well, I have not tried the animation yet, but I have written a loader that loads in .dae models. If you want, I can help you with that. Also, I wrote some stuff which explains the basics and an approach to parse the collada data file. If you want, I can share that with you.

Let me know if that works for you. PM me if you need help urgently.

I do not have any parsing experience. I will gladly accept any help you can provide.

Someone on a different site suggested I try Cal3D but I want to try to figure out the Collada.

If I can work at this everyday I hope I have enough time to parse load, draw and animate. Maybe we can help each other? Although I am not as experienced…

Cool !

Have you checked if collada dom does support animation ?

I believe that from these two sites: http://www.gamedev.net/community/forums/topic.asp?topic_id=367866 and viewtopic.php?f=12&t=1286

Collada dom and 1.4 support animations.

Ok, good…seems there is support. If not, I expect someone on the forum to let us know here.

You want to discuss more on IM ?

Just curious, since I was trying to build Collada-DOM on Linux only a couple of days back and it looked like trunk was broken. Were you able to build Collada DOM?

I ran into issus yesturday trying to use the viewer in the DOM. It has crazy include path issues. I plan on trying it again and hoping I have better luck. If I run into other problems then I’ll post them as I get to them.

trunk?

SVN trunk.

I couldnt build the download version either. Please do let me know if you make some headway with this.

In any case, if its only to read geometry, I just wrote my own parser which works as of now. However, I see that you need the animation data as well, which I have not implemented yet.

If all attempts at building Collada DOM fails I can put my source code up as a new project under MIT license and anyone interested can collaborate so as to parse the other data too (must be quite easy but laborious). Since my understanding of software design principles isnt exactly top notch and thus my code lacking in that regard, if someone else has a semi-finished Collada parser that they’d open up, I’d be happy to collaborate on that too.

I don’t know if this can be beneficial or not but there is also Assimp. It has compatibility with Collada already and is BSD 3-clause license so we can use it for whatever.

I haven’t looked at it yet to see how easy it wold be to use its Collada implementation.

ASSIMP looks awesome! How come no one told me about this?!

Well I am glad it can help! I haven’t tried looking at it yet but I hope it has what I need for animating, but if all it does is load and draw then thats a great start.

Draw? Why do you need it to draw? Anything that draws stops being an importer and starts becoming an implementation. For eg. you may want to use display lists say… I’d prefer vertex buffering it while another person would just go with the immediate mode (since you are talking about openGL).

What you’d need essentially is something (like Assimp) to parse all the data from the format for you so that you can use the data (given by Assimp like this) to do the drawing as you’d require.

my bad, I call displaying the model drawing. If the code in ASSIMP takes care of that then great!