NiVO / BY TECHNOGISGermany · Indonesia
Mesh geometry interpretation

OBJ Face Indices: Trace Relative References in a Drone Mesh

Read independent position, texture and normal indices in an OBJ face, resolve negative references at the face line, and preserve geometry before investigating import differences.

OBJ Face Indices: Trace Relative References in a Drone Mesh

Locate the face reference problem before changing the mesh

An OBJ model can retain its geometry file and every texture image yet still import with unexpected connectivity or shading. In a drone-derived mesh handoff, the next question may be how the receiving software interpreted face references rather than whether a companion file was lost. This NiVO tutorial traces independent index lists and negative references using a constructed local triangle. It does not describe a real reconstructed object, claim a NiVO product exports a particular OBJ variant or supply a measured importer result. The purpose is to make a small reference relationship inspectable before a larger delivery is changed.

Preserve the original OBJ and its associated files with a version identity. Record the exporter, receiving application, import settings and actual warnings. Distinguish a missing texture from a missing face, an altered surface orientation or a deliberately simplified mesh. Those symptoms can look similar in a convenient overview but require different checks. Choose a reported location and inspect its actual representation rather than replacing arbitrary indices until a viewer looks plausible. Keep the accepted processing master separate from any proposed correction so a later comparison can identify which bytes and interpretation changed.

Keep position, texture and normal numbering independent

The original Wavefront Appendix B1 describes separately numbered geometric vertices, texture vertices and vertex normals, each starting at one and continuing through the file. A face corner can reference those lists in position, texture, normal order with slashes between the references. Consequently a corner token does not imply that one row supplies all three properties. Start by identifying the relevant declarations and the shape of each face token. A valid-looking position reference cannot establish that the associated texture or normal reference points to the intended entry in its own list.

The tinyobjloader implementation makes the separation visible through its position, texture-coordinate and normal index fields and its parsing of the different slash forms. Its internal arrays use resolved zero-based indices, while the source OBJ has its own numbering rules. Do not copy an application-internal index back into a source face without accounting for that conversion. Likewise, a missing texture slot in a position-and-normal token is not a zero texture coordinate. Preserve absent information as absent and investigate what the receiver supports instead of inventing a row to fill every apparent gap in the imported attributes.

Restored NiVO VTOL V3 product image from the supplied brochure
Restored NiVO VTOL V3 product image from the supplied brochure.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Trace a negative reference at the face line

The following complete teaching fragment declares three positions, three texture coordinates and one normal before a single face. The position references are negative, while the texture and normal references are positive. At that face line, the three negative position references identify the first, second and third positions respectively. The extra position declared afterward is deliberately unused. It demonstrates why an earlier negative reference must be resolved in its declaration context rather than against the final length of the file. All coordinates and texture values are constructed; no project units, reference system or image material is assigned.

Read the first corner by its three domains: the third-most-recent position at that line, texture entry one and normal entry one. The next corners select the next positions and their own texture entries, while sharing the one normal. The triangle has no material library or texture image and therefore is not a demonstration of an actual textured export. Its value is the traceable relationship between declarations and references. For a real mesh, retain the source line and relevant list context with the finding, then use a maintained reader for the broader syntax and full-file inspection.

# Constructed local triangle: units and project reference not assigned.
v 0 0 0
v 2 0 0
v 0 1 0
vt 0 0
vt 1 0
vt 0 1
vn 0 0 1
f -3/1/1 -2/2/1 -1/3/1
# This later position does not change the earlier face references.
v 8 8 8

Resolve indices without silently repairing the source

For a narrow arithmetic check, convert a positive source index by subtracting one; convert a negative source index by adding it to the relevant number of declarations available at that point. With three available positions, negative three, negative two and negative one resolve to zero-based entries zero, one and two. Applying the final count of four would instead select entries one, two and three, changing the intended face. Tinyobjloader exposes this conversion in its fixIndex implementation. The same logic must use each relevant list count independently rather than substituting the total position count for texture or normal references.

Zero is not a valid source index under the specification; preserve warnings or errors associated with it instead of interpreting it as the first declared vertex. Check resolved ranges and distinguish source syntax from any sentinel used internally for missing data. A small arithmetic inspection cannot validate continuations, free-form geometry, malformed tokens or every importer extension in a large file. Do not turn the teaching rule into an ad hoc whole-file rewrite. If a maintained exporter or receiver identifies a genuine incompatibility, create a documented candidate revision and compare it with the preserved original before accepting the correction.

Separate indexing from triangulation and display changes

Once the references are understood, compare the actual import configuration. Tinyobjloader documents optional triangulation behavior and notes limitations of its built-in approach for some polygon shapes. A polygon face can therefore become several output triangles without implying that the source contained the same number of faces. Record the chosen behavior before comparing counts. Check connectivity and the locations implicated by the reported issue, and retain diagnostics. A change in polygon representation is a separate question from whether a corner pointed to the correct position, texture coordinate or normal in the source.

Shading can also change when a receiver interprets normals or generates its own display information. Avoid treating every dark patch as missing geometry or reversing face references merely to make one viewpoint brighter. Compare consistent viewing conditions and the relevant actual attributes. Texture loading remains another dependency check, covered by the separate package review. Neither an apparently repaired material nor an increased triangle count proves preservation of the intended surface. For analytical use, keep project units, axes, reference and any export shift with the mesh; index correctness alone does not establish spatial placement or survey accuracy.

Deliver an index finding that survives another import

A useful handoff records the accepted file revision, exporter and receiver, relevant source lines, declaration context and the resolved references used to investigate the issue. Include actual warnings and import settings, especially any triangulation or normal-handling choice. Explain whether the finding concerns one sampled face or a supported full-file check. A recipient should be able to trace a reported corner into the correct lists and understand why a later vertex declaration did not change it. Keep any candidate correction and comparison evidence identifiable rather than silently replacing the accepted mesh during troubleshooting.

For NiVO model discussions, this converts an ambiguous broken-mesh report into a specific relationship between source declarations, face references and receiver behavior. It complements the separate checks for material portability, schema preservation and project reference. The constructed triangle demonstrates the reference rule only; no actual importer, reconstructed scene or measurement quality was validated for the article. Preserve the original and state the next evidence needed for the intended use. A reproducible interpretation lets another analyst investigate the same problem without guessing whether a missing texture, a numbering assumption or a display setting caused the observed difference.

Technical references

  1. Wavefront Advanced Visualizer Appendix B1 — original OBJ specification, preserved text copy ↗
  2. tinyobjloader implementation — fixIndex and face-triplet parsing ↗
  3. tinyobjloader documentation — independent indices, diagnostics and triangulation ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team