Skip to content

Fix clipping of nodes when CLIP_OUTSIDE is set#45

Merged
hccampos merged 1 commit intopnext:masterfrom
rhuitl:fix-node-clipping
Aug 7, 2019
Merged

Fix clipping of nodes when CLIP_OUTSIDE is set#45
hccampos merged 1 commit intopnext:masterfrom
rhuitl:fix-node-clipping

Conversation

@rhuitl
Copy link
Copy Markdown
Contributor

@rhuitl rhuitl commented Aug 5, 2019

I was trying to use the CLIP_OUTSIDE mode but only got very few points to show up. I tracked it down to the shouldClip method which seems to return the wrong value. From its call

if (
  node.level > maxLevel ||
  !frustums[pointCloudIndex].intersectsBox(node.boundingBox) ||
  this.shouldClip(pointCloud, node.boundingBox)
) {
  continue;
}

and the early check in the method

if (material.numClipBoxes === 0 || material.clipMode !== ClipMode.CLIP_OUTSIDE) {
  return false;
}

I see that it should return true only when a node should be invisible (clipped). However in the checks further down it would return false when the node does not intersect with any of the clip boxes.

@hccampos hccampos merged commit cf72aeb into pnext:master Aug 7, 2019
@hccampos
Copy link
Copy Markdown
Contributor

hccampos commented Aug 8, 2019

Thanks @rhuitl ! Merged and released to npm, along with a few other fixes.

@rhuitl rhuitl deleted the fix-node-clipping branch October 15, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants