Skip to content

Unexpected rotation applied to OBJ models (need option to preserve original orientation without georeferencing) #79

@loicroybon

Description

@loicroybon

Problem encountered

I am using Obj2Tiles in a mesh conversion pipeline (OBJ → 3D Tiles).
My source OBJ is correct (verified in multiple viewers).
However, after conversion with Obj2Tiles, the generated 3D Tiles are misoriented: the mesh is rotated by about 30–45 degrees.

The OBJ input is correct, but Obj2Tiles applies an implicit transformation that disorients the model.


Analysis

  • The options --lat, --lon, and --alt are not used in my case (no georeferencing needed).
  • The issue occurs even without any geographic transformation.
  • The OBJ is correctly oriented in Z-up.
  • The generated tileset.json contains a 4×4 transform matrix that seems to introduce the unwanted rotation.

Typical example:

"transform": [
  -0.15971367836948433, 0.9871633810781724, 0.0, 0.0,
  -0.7036627692186165, -0.11384596649119745, 0.7013542636423288, 0.0,
   0.6923512462307532, 0.11201586928643742, 0.7128128764765174, 0.0,
   4423440.518572955, 715670.7489476459, 4523682.777249486, 1.0
]

This matrix introduces a systematic angular offset on all my models, which is not expected.


Business objective

My need is straightforward:

  • Be able to produce valid and correctly oriented 3D Tiles directly from a correct OBJ.
  • Input can be either in local coordinates (near zero) or associated with a CRS (with large coordinate values).
  • Georeferencing (--lat / --lon) should always be optional.

This would avoid extra steps of “repairing” or patching in the pipeline (post-processing, forced alignment with 3d-tiles-tools, etc.).


Proposed improvement

  • Add an explicit option to disable any automatic rotation and strictly preserve the orientation of the source OBJ.
  • Clarify in the documentation the default logic applied to the vertical axis and the generated transform matrices.

Thanks

Thanks a lot for this great tool!
A clarification (or fix) on this orientation issue would really help those like me who want to integrate Obj2Tiles in a 100% automated pipeline and generate directly usable 3D Tiles datasets, with or without georeferencing, and without post-corrections.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions