Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm building a game for iOS. I'm quite new to OpenGL but what I want is to take a 3D model I have made in Google SketchUp and use it in my 3d game. The problem is I don't know how to proceed. I have built 3d graphics in OpenGL before by specifying the vertices, but the 3D shape I have made is too complex. Is there a way .dae files can be broken down and re-formed as an OpenGL 3D model?

share|improve this question

3 Answers 3

Look into the (horribly named) AssImp asset importer library (http://assimp.sourceforge.net/). It allows loading a variety of 3D file formats into memory, which you can then use to generate your preferred in-memory format for rendering models.

You might consider using AssImp as a preprocessor pipeline stage. That is, have a separate tool to covert the Collada format into a custom format designed for your game needs. This is a production level thing, and not strictly necessary in early development or for personal projects.

share|improve this answer
2  
"AssImp". Damn. –  jco Jul 16 '12 at 18:33
    
+1. I have written a COLLADA importer before and my only advice on it is: don't. Even if all you ever want to import is COLLADA, get ASSIMP because their resultant DOM is simpler than that of a COLLADA scene, and they have post-processing optimisations built in. If you re-he-he-he-heally want to process the DAE yourself, skip the parsing stage and go straight for one of the classes produced by XSD.exe then at least you can use Intellisense to help navigate that maze! –  sebf Jul 16 '12 at 19:36

How you handle vertex buffers, that's up to you. The .dae extension means that you're dealing with a COLLADA file. COLLADA reads like any XML file you've come across and can be parsed with the same tools. There are plenty of tutorials on both COLLADA and parsing XML, there are also plenty of XML parsers availible already, which means that most of the work has been done for you. I suggest you just try searching via Google, now that you know what you're dealing with.

share|improve this answer

The ".dae" format is the Collada format. A format specifically developed as exchange format. It's not recommended to use it for games, because the data is not setup in a way it could be easily used, also Collada has a absolutly huge overhead.

Google Sketch Up isn't a suitable for making game assets either. The geometry it generates is not optimized enough for games and it doesn't give the "artist" control about that eater.

Neither were made with games or other low level applications in mind.

Well, about Collada, its XML, so you should be able to load the parts you need from it with a simple XML reader. More in-depth informations about Collada can be found at the official website: http://www.khronos.org/collada/

share|improve this answer
2  
While more or less accurate, your answer isn't an actual answer. Whether its a good idea or not, it is entirely possible to load and render game assets directly from Collada files. –  Sean Middleditch Jul 16 '12 at 18:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.