Support focusing specific 3D points in viewer (#5382)#12690
Conversation
There was a problem hiding this comment.
Hi! Thanks for opening this pull request.
Because this is your first time contributing to this repository, make sure you've read our Contributor Guide and Code of Conduct.
|
sorry about the long delay, still on my radar, just lots of other things to tend to right now! |
|
@Wumpf don't worry, take your time, there's no rush ;) |
Wumpf
left a comment
There was a problem hiding this comment.
Thanks, and thanks for being patient with me! The FocusTarget approach looks nice and consistent to me, I like it.
The eye.rs change is probably fine, but I think @IsseW should probably have another look whether it makes sense in all those cases 🤔
|
oh and thanks for writing such a well motivated description which explains why you're doing things a certain way. Kinda rare these days to see that with all those agents around 😅 |
|
@rerun-bot reality-sync |
|
Sync complete. Mirror PR in reality: https://github.com/rerun-io/reality/pull/1319 Triggered by @Wumpf |
|
Nice! Think the code in eye.rs looks good. Trying it I noticed that double clicking an instance also still selects the whole entity. So feels like there's a disconnect between what is focused and what is selected. A suggestion from @gavrelina was to kind of have this be a rolling event, which cycles between selecting & focusing a single point vs selecting & focusing the whole entity on double click. Meaning:
|
|
@bchretien sorry for the long hold-up. We talked about this today internally and figured we'll take your contribution as is, I'll resolve the conflicts and shepard it in :) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
5d3a3d3 to
f54165a
Compare
f54165a to
5aef897
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
@rerun-bot reality-sync |
|
The corresponding reality PR was merged: https://github.com/rerun-io/reality/pull/1319 However, this PR could not be automatically merged because: simulated squash merge tree doesn't match expected sync commit The changes have been synced via a direct commit instead: ddda5cf This PR can now be closed. |
|
some trouble with our internal mono repo, but as ⬆️ says, the fix got in :) |
Related
What
This is an attempt to solve #5382, that is the ability to center the camera on a specific 3D point when clicking (similar to how it was working before version 0.13.0) and not the whole entity. This is especially useful when analyzing large meshes or point clouds, where details may matter.
To do that, the focused item has now an optional
ItemContextattached (seeFocusTargetclass that I can rename if necessary). If a 3D position is detected in theItemContext, a new case is added to the dispatch logic to focus that point. For the new camera parameters, I went with the same forward vector, and the same distance to the point as when it was clicked, unless we're further away than the entity bounding sphere radius x 1.5. Thus, if we're far away we get the full entity in view while targeting the point, and if we were already close to the entity, we keep a similar distance to avoid large translations when clicking points that are nearby. UX is not my forte, so I'm not sure if that's the best approach for a wider user base.I saw afterwards that the content of
FocusTargetis kinda redundant with theItemCollectioninternals, whereItemandItemContextare associated. Before attempting any cleanup, I'd appreciate some feedback :)DISCLAIMER: as I'm not familiar with the rerun codebase, the heavy lifting was done by ChatGPT-5.4 Thinking, so there may be some inefficiencies there. I did not have much time to work on it, so I'm even surprised to have something that works for my use case at all :)