Reputation: 1029
Ok i'm really wanting to use 3D models in my new Android app. It's not going to be anything too complex with regards to 3D models, but never the less I need import 3D models. My question is what would be the best way to import 3D Models?? I'm aware I can use vertex positions and indices for drawing models, so what 3D format could i open as a text file to read these values?? Or is there an easier way to import 3D models into android projects?? It seems strange there isn't some form of mesh importer functionality already built-in. I've looked into Libgdx engine which looks helpful, however I can't find any examples where they use model files directly (.OBJ).
Any help would be great
Upvotes: 3
Views: 1801
Reputation: 1029
Thought I'd close off this question of mine. I managed to find a little snippet of code that lets me import .OBJ files using the LibGDX functions, see below:
stream = Gdx.files.internal("Hammer/test_hammer.obj").read();
String s = stream.toString();
//model = ModelLoaderOld.loadObj(stream);
Mesh m_Mesh = ObjLoader.loadObj(stream,true);
stream.close();
I hope this helps some of you out :).
Upvotes: 3