4

I'm developing an iOS app with augmented reality using Qualcomm Vuforia and I have difficulty in understanding how to create 3D models from Blender (or other softwares). All the examples use .h files with the coordinates of the vertices to generate i.e. a teapot. I can not find documentation useful for me. Is there a tool to convert .blend or .obj files to .h (OpenGL ES)?

thanks

alesic
  • 197
  • 2
  • 9

3 Answers3

10

I developed a script called mtl2opengl that does exactly what you need, based on the project obj2opengl. The script works with .obj and .mtl files, which I think can be exported straight from Blender, and produces .h files with vertex data. I use it extensively in my iOS augmented reality applications (though I haven't used the Vuforia SDK yet) and the accompanying resources include a sample Xcode project too. Hope it helps!

Ricardo RendonCepeda
  • 3,271
  • 4
  • 23
  • 30
  • After finally using the Vuforia SDK, I can confirm that my script definitely works with it! I might even make a further project integrating the two. – Ricardo RendonCepeda Apr 03 '13 at 18:13
  • Hi. I need to create a .h file from .3ds file. Is it possible? Please help. – ScarletWitch Sep 07 '13 at 11:19
  • I've never used 3ds Max, but a quick look at the [docs](http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Help/index.html?url=files/GUID-437051A1-983B-4B6A-80C4-D2FA43B7393D.htm,topicNumber=d30e125257) suggests that you can definitely export .3ds to .obj. If you then run the .obj with my script, you should get your .h file :) – Ricardo RendonCepeda Sep 07 '13 at 16:15
  • I ran this but it didnt include normal data for some reason, will edit this post if I find a solution to get it to work correctly. – David van Dugteren Sep 13 '13 at 06:32
  • I'll be updating the script/project soon, and i'll pay extra attention to this if there's an issue. – Ricardo RendonCepeda Sep 16 '13 at 05:43
  • Hi I used your script to convert .obj file to .h. But I need to create a MeshObject for my Android app. It requires indices. How to achieve this? Anyone have an idea? – Munazza May 06 '14 at 14:15
5

You should check out BlenderVuforiaExport (developed by a coworker of mine) here:

https://github.com/StickyBeat/BlenderVuforiaExport

It exports objects from Blender to the same .h-format used in the Vuforia example project.

Supercranky
  • 311
  • 3
  • 5
0

I don't know much about vufoia, but here are two answers about using blender to get 3d models and displaying them on iPhone. These may help you.

How to get proper number of vertices in OBJ file from DCC tools such as Blender for use in OpenGL ES?

Put a Cinema 4D model and Texture into an iPhone App

Community
  • 1
  • 1
erkanyildiz
  • 13,044
  • 6
  • 50
  • 73