Skip to content

Commit

Permalink
Compressed ply orientation fix (playcanvas#7064)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed Oct 24, 2024
1 parent e737403 commit bacb3d6
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 @@ -74,9 +74,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 @@ -231,17 +231,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 bacb3d6

Please sign in to comment.