Practical and production ready

Note that, as mentioned earlier, we've created a limited implementation of the OBJ model format, so not every model that you find will view correctly (if at all) at this point. Then again, it might be sufficient, depending on the requirements of your own projects, for example, if you include specific models in the resource folder that can be viewed in the released version of your app. When you have complete control of the input data, you can cut corners.

While the basic structure of the OBJ file format is not very complicated, as we've demonstrated here, like many things in software (and in life) "the devil is in the details." Using this project as a starting point, and then building your own practical and production-ready OBJ file parser and renderer will require a considerable amount of additional work. You might also do some research on pre-existing packages, other model formats, or maybe even lifting some code from an open-source game engine like LibGDX. The features of OBJ that we omitted but are worth considering include the following:

  • Texture vertices
  • Material definitions
  • Curve elements
  • Grouping of geometry
  • Color and other vertex attributes
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset