4
\$\begingroup\$

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?

\$\endgroup\$

3 Answers 3

7
\$\begingroup\$

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.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ "AssImp". Damn. \$\endgroup\$
    – jcora
    Jul 16, 2012 at 18:33
  • 1
    \$\begingroup\$ +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! \$\endgroup\$
    – sebf
    Jul 16, 2012 at 19:36
  • \$\begingroup\$ Asset-Importer-Lib was the name initially. \$\endgroup\$
    – KimKulling
    Feb 6, 2017 at 10:35
3
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

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/

\$\endgroup\$
1
  • 3
    \$\begingroup\$ 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. \$\endgroup\$ Jul 16, 2012 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .