Skip to content

Support focusing specific 3D points in viewer (#5382)#12690

Closed
bchretien wants to merge 2 commits into
rerun-io:mainfrom
bchretien:feat/focus-point-click
Closed

Support focusing specific 3D points in viewer (#5382)#12690
bchretien wants to merge 2 commits into
rerun-io:mainfrom
bchretien:feat/focus-point-click

Conversation

@bchretien
Copy link
Copy Markdown
Contributor

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 ItemContext attached (see FocusTarget class that I can rename if necessary). If a 3D position is detected in the ItemContext, 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 FocusTarget is kinda redundant with the ItemCollection internals, where Item and ItemContext are 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 :)

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Wumpf Wumpf self-requested a review March 13, 2026 09:26
@Wumpf
Copy link
Copy Markdown
Member

Wumpf commented Mar 18, 2026

sorry about the long delay, still on my radar, just lots of other things to tend to right now!

@bchretien
Copy link
Copy Markdown
Contributor Author

@Wumpf don't worry, take your time, there's no rush ;)

Copy link
Copy Markdown
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤔

@Wumpf
Copy link
Copy Markdown
Member

Wumpf commented Mar 24, 2026

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 😅

@Wumpf
Copy link
Copy Markdown
Member

Wumpf commented Mar 25, 2026

@rerun-bot reality-sync

@rerun-sync
Copy link
Copy Markdown
Contributor

rerun-sync Bot commented Mar 25, 2026

Sync complete. Mirror PR in reality: https://github.com/rerun-io/reality/pull/1319

Triggered by @Wumpf

@IsseW
Copy link
Copy Markdown
Member

IsseW commented Mar 25, 2026

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:

  • If only the instance is selected and it's double clicked, we select & focus the whole entity.
  • Otherwise we select & focus the given instance on double click.

@Wumpf
Copy link
Copy Markdown
Member

Wumpf commented Apr 10, 2026

@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 :)

@Wumpf Wumpf added 📺 re_viewer affects re_viewer itself include in changelog labels Apr 10, 2026
@Wumpf

This comment was marked as outdated.

@rerun-sync

This comment was marked as resolved.

@Wumpf Wumpf force-pushed the feat/focus-point-click branch from 5d3a3d3 to f54165a Compare April 10, 2026 21:22
@Wumpf Wumpf force-pushed the feat/focus-point-click branch from f54165a to 5aef897 Compare April 10, 2026 21:24
@Wumpf

This comment was marked as outdated.

@Wumpf
Copy link
Copy Markdown
Member

Wumpf commented Apr 11, 2026

@rerun-bot reality-sync

@rerun-sync
Copy link
Copy Markdown
Contributor

rerun-sync Bot commented Apr 11, 2026

⚠️ This PR was not auto-merged

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.

@Wumpf
Copy link
Copy Markdown
Member

Wumpf commented Apr 12, 2026

some trouble with our internal mono repo, but as ⬆️ says, the fix got in :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double-click to focus on a point no longer works

3 participants