Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect bounding box calculation for camera view parts #4640

Merged
merged 3 commits into from Jan 3, 2024

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Jan 2, 2024

What

The wrong transform was being used for the bounding box calculation.
Clarify the transform naming / construction.
Also include the origin when the origin axes are turned on.

image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@jleibs jleibs added 📺 re_viewer affects re_viewer itself include in changelog labels Jan 2, 2024
@jleibs jleibs marked this pull request as ready for review January 2, 2024 16:02
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Looks good!

crates/re_space_view_spatial/src/parts/cameras.rs Outdated Show resolved Hide resolved
@@ -380,6 +380,9 @@ pub fn view_3d(
axis_length,
re_renderer::OutlineMaskPreference::NONE,
);

// If we are showing the axes for the space, then add the space origin to the bounding box.
state.scene_bbox.extend(glam::Vec3::ZERO);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this. Maybe. The bounding box is used for auto-positioning of the camera, and I'm not sure users are always interested in seeing the bounding box axes (though, to be fair, they did turned them on).

When we have a 3D grid we definitely don't want to include it in the bounding box (since it is infinite) 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

My thought is that since origin axes are opt-in, if you've taken the action of enabling it, you should see it when you reset your view without needing to do significant zooming / panning to "search" for it.

@jleibs jleibs merged commit 2da0c09 into main Jan 3, 2024
40 of 41 checks passed
@jleibs jleibs deleted the jleibs/fix_camera_view_bounds branch January 3, 2024 15:24
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.

Bounding box not taking transformation hierarchy for rr.Pinhole correctly into account
2 participants