Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressed ply orientation fix #7064

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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