How can an .obj file be converted to Android openGL?

10,289

Solution 1

You essentially have 3 options:

  1. Adopt the use of a comprehensive framework that contains model loading capabilites like Min3D , Bonzai or Rajawali. (There is a metric ton of these frameworks) Personally, I prefer Min3D as it imposes the most minimal constraints on your application design and it is has been use tested more heavily than most of the alternatives. A good tutorial for loading models with Min3D can be found here.

  2. Use a standalone model loader written for Android in Java like this one. Licence is GPL if I am remembering correctly and interaction with it's API is fairly trivial.

  3. Write your own model loader! OBJ is just about the simplest file format in existence to parse and it would only take an hour or two to construct your own custom loader. This avenue will alleviate any licensing concerns you may have and, if you are new to 3D rendering, it may serve as a helpful exercise.

Solution 2

There is free library for using 3D objects in android Rajawali. You can get all information here. It has some very nice tutorials to begin with I hope this will help you. It will also show how to use .obj file.

You can get library from here.

And also download this application from them to check examples based on Rajawali.

Share:
10,289
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I have a .obj file (a 3D model), but I have no idea on how to load it into Android openGL. How is this accomplished?

    Are there any step by step tutorials on this subject?