Skip to content

Commit

Permalink
Compressed ply orientation fix (#7064)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck authored Oct 24, 2024
1 parent 9889e72 commit a481cd2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions src/framework/parsers/gsplat-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 0 additions & 8 deletions src/scene/gsplat/gsplat-compressed-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a481cd2

Please sign in to comment.