rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

iOS: Exported .obj model has incorrect orientation compared to in-app view

Open gulam-luxolis opened this issue 6 months ago • 1 comments

After scanning a scene and confirming optimization (Scan > Optimization alert > Yes), the generated model renders as expected — it appears oriented as I scanned it, with what feels like a front view (see attached screenshot).

Image

However, when I export the scan and open the resulting .obj file, the model seems to be rotated along an axis (please refer to the attached exported model screenshot).

Image

to see the model properly I have to manually adjust it,

Image

Could you please help me understand how to export the model so that it retains the same orientation as shown before exporting?

gulam-luxolis avatar Jun 23 '25 10:06 gulam-luxolis

We disabled the 90 deg rotation when we did the first ios release: https://github.com/introlab/rtabmap/blob/30962119cb4d871fa60121fa9d2d3c6875a6f093/app/android/jni/RTABMapApp.cpp#L4393-L4397

The exported OBJ is actually in same coordinate frame than the one used in the app: z->up, x->forward, y->left. Your OBJ viewer is probably showing the model in a coordinate frame like: z->backward, x->right, y->up (or right-handed opengl frame).

Note that 3D viewers like MeshLab or CloudCompare would show the model in the right orientation. We could add a new option when exporting to ask in which coordinate frame we want the model. Labeling this issue as enhancement.

matlabbe avatar Jun 29 '25 00:06 matlabbe