Closed anonymous2585 closed 3 days ago
@atteneder Can you please take a look at this issue? It affects people using draco exports, and the fix seems pretty easy.
@anonymous2585 Great find and excellent report! The fix will land in one of the upcoming updates.
Describe the bug When exporting a mesh using draco compression, the mesh bounds written in the file is inverted on the X axis.
File OffsetCube.zip
To Reproduce
See the object been culled by Unity even when still in view.
Expected behavior The bounding box is correct and user doesn't need to use Mesh.RecalculateBounds to fix the mesh bounds.
Proposed fix We fixed this issue locally by adding a
-
here: https://github.com/atteneder/glTFast/blob/ef121f3a88707d79c178f4d573620566b1ced6b9/Runtime/Scripts/Export/GltfWriter.cs#L1213 (changed to-center.x-extents.x,
)And here: https://github.com/atteneder/glTFast/blob/ef121f3a88707d79c178f4d573620566b1ced6b9/Runtime/Scripts/Export/GltfWriter.cs#L1219 (changed to
-center.x+extents.x,
)If you look at the legacy export, there is the
-
sign on X axis: https://github.com/atteneder/glTFast/blob/ef121f3a88707d79c178f4d573620566b1ced6b9/Runtime/Scripts/Export/GltfWriter.cs#L1389 so we think it has been forgotten in the draco code.Setup