Skip to content

Commit

Permalink
fix(pointcloud): Fix point cloud distance to camera whatever point cl…
Browse files Browse the repository at this point in the history
…oud initial placement is
  • Loading branch information
Alexis DELFORGES authored and Desplandis committed Sep 16, 2024
1 parent a01de04 commit ff9a86a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Layer/PointCloudLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class PointCloudLayer extends GeometryLayer {
}

elt.notVisibleSince = undefined;
point.copy(context.camera.camera3D.position).sub(this.object3d.position);
point.copy(context.camera.camera3D.position).sub(this.object3d.getWorldPosition(new THREE.Vector3()));
point.applyQuaternion(this.object3d.getWorldQuaternion(new THREE.Quaternion()).invert());

// only load geometry if this elements has points
if (elt.numPoints !== 0) {
Expand Down

0 comments on commit ff9a86a

Please sign in to comment.