1

Hey I have an object I want to use in my iPhone application. Currently I do that by exporting the 3D object to .obj (Wavefront) format but it does not export the texture.

I read I would have to use the "bake texture" function inside Cinema4D (in the object manager) but that does not list Wavefront as possible export format.

Is there a way to include the texture when exporting?

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174

2 Answers2

2

Can you only read Wavefront obj in your app ? This format does not include texture bitmap data. Only vertex positions, normals and texture coordinates. The materials are exported in *.mtl files (Material Template Library) that can reference textures to map on different objects declared inside the obj file. If your obj parser can use mtl files along with your obj, then you may tell him as well to load the mtl. However I would suggest you take a look at more modern exchange formats (and corresponding parser) such as collada. Those more recent formats can store many info, like textures, shaders, animation, physics elements, etc... The collada file could look heavier but is far more autonomous so practical to move from one application to another.

  • Oh I see...can collada be used by open gl? – LinusGeffarth Feb 10 '15 at 14:12
  • There are many collada parsers out there for all flavors of rasterizing libraries (Direct3D or OpenGL, etc..). The format is there for data exchange purposes so not that depending on the rasterizer your framework may use (of course, if your surfaces use HLSL or Cg shaders, you may want to port them-very easy - to GLSL before exporting to Collada from your favorite DCC tool, to use them with OpenGL). Basically, your data is stored like it would be with obj but with much more info. Find an OpenGL Collada parser / viewer example, and you will load many more info from your scenes than with objs. –  Feb 22 '15 at 11:18
1

Here my two cents:

export to fbx and then use the free tool Autodesk FBX converter (downloadable here: http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=22694909).

Under "Destination format" there is also the OBJ option. The result is complete with geometry and materials (mtl file).

deblocker
  • 7,629
  • 2
  • 24
  • 59