1

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?

1

1 Answer 1

5

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.

2
  • excelent thank you. Do you think there is a way to do this work in an Android device? Jul 12, 2013 at 11:20
  • 1
    No, fbx-conv relies on the FBX SDK, which afaik is not available for android.
    – Xoppa
    Jul 12, 2013 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.