glTFast
glTFast copied to clipboard
The initial direction of GLB model import is wrong
Describe the bug Hello, I just started using Gltfast. Gltfast is very useful. I like it very much, but I still have some problems because of my ability. I want to ask for advice.
When I import the model with Gltfast, I find that the initial orientation of the model is always behind the Z axis (0,0, -1), whether it is editor or runtime.
So it's very inconvenient for me to operate the model in the game. I want to ask what configuration can make the direction of the model conform to the front of the Z axis (0, 0,1)?
GLB file export The GLB model was exported from Unity using UniGltf ver2.28.0.
To Reproduce Steps to reproduce the behavior:
- Export GLB model from Unity using UniGltf
- Drag GLB model to Unity
- Gltfast Import GLB model
- See that the initial direction of GLB model is wrong
Expected behavior The orientation of the model should be the front of the Z axis (0, 0,1)
Screenshots
Desktop (please complete the following information): glTFast version 4.8.3 Unity Editor version 2020.3.24f1c2 Render Pipeline and version HDRP 10.7.0 Platform: Win64_86 build (running on a 64x machine) as well as in Win64 editor.
additionally (if significant for the bug):
- Device: GTX 3060
- OS: Win10
Are you sure this isn't a bug in export from UniGltf? glTFast (and dev UnityGltf, for that matter) properly respect orientations on import and export for quite a while.
I'm also quite confident that this not a bug on glTFast side, but rather an inconsistency with UniGltf.
Historical background: Up until version 3.x, glTFast used to convert models from glTF's to Unity's coordinate system in a different way. See Coordinate System Conversion Change.
As you can see, at first I tried to keep X and Y axis aligned (and flip the Z axis). There's nothing wrong with it, expect glTF defines positive Z as forward (just like Unity) and thus many users had the same problem you have: models face the wrong way.
That's what convinced me to change the conversion (keep Y and Z axis and flip X). As @hybridherbst mentioned, this is consistent with many other importers and I see it as the correct way.
I recommend filing an issue with UniGltf.
Thanks
I'm also quite confident that this not a bug on glTFast side, but rather an inconsistency with UniGltf.
Historical background: Up until version 3.x, glTFast used to convert models from glTF's to Unity's coordinate system in a different way. See Coordinate System Conversion Change.
As you can see, at first I tried to keep X and Y axis aligned (and flip the Z axis). There's nothing wrong with it, expect glTF defines positive Z as forward (just like Unity) and thus many users had the same problem you have: models face the wrong way.
That's what convinced me to change the conversion (keep Y and Z axis and flip X). As @hybridherbst mentioned, this is consistent with many other importers and I see it as the correct way.
I recommend filing an issue with UniGltf.
Thanks
OK, I understand. Thank you very much for your reply!