Skip to content

Commit

Permalink
Fix 3d picking projection with camera offset (#3749)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Oct 4, 2019
1 parent fddf1ab commit 2894929
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/core/src/lib/deck-picker.js
Expand Up @@ -186,8 +186,9 @@ export default class DeckPicker {
redrawReason: 'pick-z',
pickZ: true
});
// picked value is in common space (pixels)
z = zValues[0] * viewports[0].distanceScales.metersPerPixel[2];
// picked value is in common space (pixels) from the camera target (viewport.position)
// convert it to meters from the ground
z = zValues[0] * viewports[0].distanceScales.metersPerPixel[2] + viewports[0].position[2];
}

// Only exclude if we need to run picking again.
Expand Down

0 comments on commit 2894929

Please sign in to comment.