Importing Wavefront .obj files for android

9.1k Views Asked by At

What is the best way importing .obj files to android app created in Blender? I want the best and the easyest variant! How about a link to a tutorial?

2

There are 2 best solutions below

2
On

Personally I have implemented the OBJ reader long time ago in Android Native C and in that case the issue is quite more complicated than doing it in Java.

The easiest way is to open the file in text mode and parse the file following its logic.

The logic i very very simple and you can find the file format here:

http://www.martinreddy.net/gfx/3d/OBJ.spec

The writing of such a code won't take more than 2 days of an average skilled developer, i suggest you to do it your own to have a better control of your code.

In alternative, if you want it ready, you can find and adapt this Java loader:

http://www.java2s.com/Code/Java/3D/ObjectFileLoader.htm

Cheers

5
On

Here is a simple .obj file reader class specifically written to work with Android. Comes as part of a complete sample program you can use to try it out.