From a481cd2a69acf80f18d479796bbf9c7a024e289e Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Thu, 24 Oct 2024 15:18:43 +0100 Subject: [PATCH] Compressed ply orientation fix (#7064) --- src/framework/parsers/gsplat-resource.js | 4 +--- src/scene/gsplat/gsplat-compressed-data.js | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/framework/parsers/gsplat-resource.js b/src/framework/parsers/gsplat-resource.js index 7b2eb3802d7..daac2ec47e1 100644 --- a/src/framework/parsers/gsplat-resource.js +++ b/src/framework/parsers/gsplat-resource.js @@ -68,9 +68,7 @@ class GSplatResource { // the ply scene data no longer gets automatically rotated on load, so do // it here instead. - if (!this.splatData.isCompressed) { - entity.setLocalEulerAngles(0, 0, 180); - } + entity.setLocalEulerAngles(0, 0, 180); // set custom aabb component.customAabb = splatInstance.splat.aabb.clone(); diff --git a/src/scene/gsplat/gsplat-compressed-data.js b/src/scene/gsplat/gsplat-compressed-data.js index cae45eed5bb..b938b01e27e 100644 --- a/src/scene/gsplat/gsplat-compressed-data.js +++ b/src/scene/gsplat/gsplat-compressed-data.js @@ -225,17 +225,9 @@ class GSplatCompressedData { const iter = this.createIter(p, r, s, c); - // the compressed data is stored "right way up" so must - // be flipped upside down during decompression to match - // uncompressed orientation. - const q = new Quat().setFromEulerAngles(0, 0, 180); - for (let i = 0; i < this.numSplats; ++i) { iter.read(i); - q.transformVector(p, p); - r.mul2(q, r); - data.x[i] = p.x; data.y[i] = p.y; data.z[i] = p.z;