Wavefront format and OBJ LOADER seems to have an non obvious reversal on Z axis


I’m experiencing directly in sandbox 3D file import with OBJ file format and it seems that orientation is “z-reversed” regarding all other viewers I could find. That makes texts “reversed”
The other issue is the support of lines import. Although lines are imported with GLTF format, it’s not supported by OBJ import.
Is there a technical reason or it’s because OBJ is maybe not the best choice nowadays compared to GLTF ?

assets.zip (930.9 KB)

Import of OBJ in SketchFab

Adding @bghgary who already worked on similar issue with obj

My guess it that you need to switch Babylon to be right handed (we are left handed by default) using:

scene.useRightHandedSystem = true

You need to do it right after creating the scene object


@Deltakosh Thanks for your answer.
I understand your point of view when developing with BJS, it is possible to tweak.
But what about users that are testing/using BJS with the sandbox and are importing OBJ.
The behaviour is, up to my mind, “unexpected” and looks awkward

There is no way to test it unfortunately as half of the OBJ will use the other convention so if we fix it for your case it will break other cases

My ubber recommendation is to use glTF :slight_smile:

1 Like