Question

I'm working on a project where we need to convert .OBJ models into .G3DJ (JSON) format on the fly. I've tried with this code I've founded in google code.

https://code.google.com/p/libgdx-users/wiki/ImportingModelsFromBlender

  ObjLoader loader = new ObjLoader();
  StillModel model = loader.loadObj(Gdx.files.internal("data/model.obj"), true);
  G3dExporter.export(models, Gdx.files.absolute("data/model.g3d"));

But StillModel and G3DExporter cannot be found in libgdx.

Any ideas?

Was it helpful?

Solution

The libgdx-users wiki is not up to date. Converting an OBJ file to G3DJ (or G3DB) can be done using fbx-conv, which is a command line utility (you can call it from code if you like).

Also make sure to update to the nightly build. StillModel is no longer supported (and does not support the G3DJ (JSON) file format).

It is recommended not to use OBJ (although it is still supported). Instead use FBX (converted to G3Dx), which supports more functionality than OBJ.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top