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

New LeafTransform3D, replacing OutOfTreeTransform3D #7015

Merged
merged 31 commits into from
Jul 31, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Jul 30, 2024

What

Introduces a new LeafTransform3D archetype that is always applicable. It entails a copy of all of Transform3D's components - axis length and transform relation have been omitted so far.

Surprisingly, I didn't have much need for the extensive extensions we have on Transform3D so far: Leaf transform is much less commonly used and deals with arrays, making it sufficiently different from Transform3D. Also a lot of the extensions associated with Transform3D are there for legacy reasons - with the new more componetized interface we get much more reasonable ergonomics out of the box!

This PR entails a major overhaul of the TransformContext. For sure not the last time we do this (looking at you 2D transform handling & not-so-great 2D<->3D interactions!), but the intention is to be a bit more forward looking and to enforce use of leaf transforms everywhere.

Single component leaf transforms are supported everywhere now. Multi component leaf transforms logs a warning for all visualizers except Mesh3D and Asset3D where it bottoms out in instantiating the mesh multiple times:

Screen.Recording.2024-07-30.at.11.10.57.mov

Snippet demonstrating combination of Transform3D with LeafTransforms3D:

Screen.Recording.2024-07-30.at.12.15.53.mov

Follow-up PRs will improve the interaction of various archetypes with LeafTransforms3D as well as remove now unused legacy types.

Checklist

  • run main ci to ensure that roundtrip & snippet tests are passing
  • check transform checklist again!
  • 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
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@Wumpf Wumpf added 🍏 primitives Relating to Rerun primitives include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages labels Jul 30, 2024
Copy link

github-actions bot commented Jul 30, 2024

Deployed docs

Commit Link
0e22047 https://landing-ah0otlwa2-rerun.vercel.app/docs

@Wumpf
Copy link
Member Author

Wumpf commented Jul 30, 2024

@rerun-bot full-check

Copy link

@Wumpf
Copy link
Member Author

Wumpf commented Jul 31, 2024

@rerun-bot full-check

Copy link

Copy link
Member

@jleibs jleibs left a comment

Choose a reason for hiding this comment

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

Sharp data-model corners aside, really like that these feel like part of the same system now!

/// From the point of view of the entity's coordinate system,
/// all components are applied in the inverse order they are listed here.
/// E.g. if both a translation and a max3x3 transform are present,
/// the 3x3 matrix is applied first, followed by the translation.
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to see this one drawn out in a diagram some day.

Comment on lines -196 to -202
if spatial_ctx.space_view_class_identifier == SpatialSpaceView2D::identifier() {
self.data.add_bounding_box(
entity_path.hash(),
bounding_box_for_textured_rect(&textured_rect),
spatial_ctx.world_from_entity,
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this just no longer necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

It still is, but moved inside of textured_rect_from_tensor

@Wumpf Wumpf merged commit cdeac62 into main Jul 31, 2024
40 of 42 checks passed
@Wumpf Wumpf deleted the andreas/introduce-leaf-transform3d branch July 31, 2024 16:41
Wumpf added a commit that referenced this pull request Jul 31, 2024
…, remove `Transform3D` component (#7000)

### What

* build on top of #7015

Removes
* Scale3D datatypes
* Transform3D datatype
* TranslationRotationScale3D datatype
* Transform3D component

compatibility considerations were already done all in previous PRs. For
some of these there's utilities to make actual use similar to before.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7000?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7000?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7000)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages 🍏 primitives Relating to Rerun primitives
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants