Menu

Importing Models

g-dollar

OBJParser

The OBJ file importer handles models exported with triangle faces; do not use quads.

Vertex, Texture, Normal are all imported; you can suppress import of Texture and/or Normal via parser options.

No material information (e.g. "mtllib") is supported.

Texture Coordinates (UV)

It is important to know that a Bitmap has its origin in the Upper-Left, whereas the Texture Coordinate system (UV) has its origin in the Lower-Left. What this means is textures will appear "upside-down" or otherwise inverted when you view the texture-mapped model.

This can be handled in one of these ways:

  • Pre-invert the Texture (V) coordinate before you export the OBJ.
  • Use the Invert-V parser option (preferred).

OBJModelGeometry

This is a Geometry subclass that provides InterleavedVertexGeometry created by the OBJParser.

Exporting OBJ Geometry

Make sure you use the following settings when exporting OBJ geometry, to avoid unexpected results when rendering in GL:

  • Triangulate Faces
  • Positive Y-axis is Up
  • Negative Z-axis is Forward

The last two are important, because GL and modelling tools typically use different axis orientations. If you don't set these, your model will render with incorrect orientation in GL.

Some tools have other options that may affect correct output; outside the scope of this topic.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.