From f4487c73fcc27150e2975a3a88b7c37ff1106ff3 Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Wed, 3 Apr 2024 13:24:56 +0200 Subject: [PATCH 1/2] Fix node picking regression that allowed to select nodes that were not visible. Fix far clipping distance for flight/oblique mode. --- .../oxalis/view/rendering_utils.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/javascripts/oxalis/view/rendering_utils.ts b/frontend/javascripts/oxalis/view/rendering_utils.ts index 75ce7f6a00..d7978b9a33 100644 --- a/frontend/javascripts/oxalis/view/rendering_utils.ts +++ b/frontend/javascripts/oxalis/view/rendering_utils.ts @@ -1,7 +1,7 @@ import * as THREE from "three"; import { saveAs } from "file-saver"; import Store from "oxalis/store"; -import { OrthoView } from "oxalis/constants"; +import { ARBITRARY_CAM_DISTANCE, OrthoView } from "oxalis/constants"; import constants, { ArbitraryViewport, OrthoViewColors, @@ -59,25 +59,28 @@ export function renderToTexture( // Don't respect withFarClipping for the TDViewport as we don't do any clipping for // nodes there. if (withFarClipping && plane !== OrthoViews.TDView) { - function adaptCameraToCurrentClippingDistance( - camera: THREE.OrthographicCamera | THREE.PerspectiveCamera, - ) { + function adaptCameraToCurrentClippingDistance< + T extends THREE.OrthographicCamera | THREE.PerspectiveCamera, + >(camera: T): T { const isArbitraryMode = constants.MODES_ARBITRARY.includes( state.temporaryConfiguration.viewMode, ); - camera = camera.clone(); + camera = camera.clone() as T; + // The near value is already set in the camera (done in the CameraController/ArbitraryView). if (isArbitraryMode) { - camera.far = state.userConfiguration.clippingDistanceArbitrary; + // The far value has to be set, since in normal rendering the far clipping is + // achieved by the data plane which is not rendered during node picking + camera.far = ARBITRARY_CAM_DISTANCE; } else { - // The near value is already set in the camera (done in the CameraController). // The far value has to be set, since in normal rendering the far clipping is // achieved by offsetting the plane instead of setting the far property. camera.far = state.userConfiguration.clippingDistance; } camera.updateProjectionMatrix(); + return camera; } - adaptCameraToCurrentClippingDistance(camera); + camera = adaptCameraToCurrentClippingDistance(camera); } clearColor = clearColor != null ? clearColor : 0x000000; From 6f0828a7aa4a982173270a862e271cdc166bcc2b Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Wed, 3 Apr 2024 13:31:17 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.unreleased.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 3e39613610..ee6ae5c7e5 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -24,6 +24,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released - Fixed that the Command modifier on MacOS wasn't treated correctly for some shortcuts. Also, instead of the Alt key, the ⌥ key is shown as a hint in the status bar on MacOS. [#7659](https://github.com/scalableminds/webknossos/pull/7659) - Moving from the time tracking overview to its detail view, the selected user was not preselected in the next view. [#7722](https://github.com/scalableminds/webknossos/pull/7722) - Fixed incorrect position of WEBKNOSSOS logo in screenshots. [#7726](https://github.com/scalableminds/webknossos/pull/7726) +- Fixed that invisible nodes could be selected when using the skeleton tool. [#7732](https://github.com/scalableminds/webknossos/pull/7732) ### Removed