Skip to content

Commit 13ac94e

Browse files
committed
fix confusion about transform ordering 😳
1 parent b1277a1 commit 13ac94e

7 files changed

Lines changed: 29 additions & 24 deletions

File tree

crates/store/re_types/definitions/rerun/archetypes/transform3d.fbs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ namespace rerun.archetypes;
33

44
/// A transform between two 3D spaces, i.e. a pose.
55
///
6-
/// All components are applied in the inverse order they are listed here.
7-
/// E.g. if both a 4x4 matrix with a translation and a translation vector are present,
8-
/// the translation is applied first, followed by the matrix.
6+
/// From the point of view of the entity's coordinate system,
7+
/// all components are applied in the inverse order they are listed here.
8+
/// E.g. if both a translation and a max3x3 transform are present,
9+
/// the 3x3 matrix is applied first, followed by the translation.
910
///
1011
/// Each transform component can be listed multiple times, but transform tree propagation is only possible
1112
/// if there's only one instance for each transform component.

crates/store/re_types/src/archetypes/transform3d.rs

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/viewer/re_space_view_spatial/src/contexts/transform_context.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,20 +368,20 @@ fn get_parent_from_child_transform(
368368
// Order is specified by order of components in the Transform3D archetype.
369369
// See `has_transform_expected_order`
370370
let mut transform = glam::Affine3A::IDENTITY;
371-
if let Some(mat3x3) = result.get_instance::<TransformMat3x3>(resolver, 0) {
372-
transform *= glam::Affine3A::from(mat3x3);
371+
if let Some(translation) = result.get_instance::<Translation3D>(resolver, 0) {
372+
transform *= glam::Affine3A::from(translation);
373373
}
374-
if let Some(scale) = result.get_instance::<Scale3D>(resolver, 0) {
375-
transform *= glam::Affine3A::from(scale);
374+
if let Some(rotation) = result.get_instance::<RotationAxisAngle>(resolver, 0) {
375+
transform *= glam::Affine3A::from(rotation);
376376
}
377377
if let Some(rotation) = result.get_instance::<RotationQuat>(resolver, 0) {
378378
transform *= glam::Affine3A::from(rotation);
379379
}
380-
if let Some(rotation) = result.get_instance::<RotationAxisAngle>(resolver, 0) {
381-
transform *= glam::Affine3A::from(rotation);
380+
if let Some(scale) = result.get_instance::<Scale3D>(resolver, 0) {
381+
transform *= glam::Affine3A::from(scale);
382382
}
383-
if let Some(translation) = result.get_instance::<Translation3D>(resolver, 0) {
384-
transform *= glam::Affine3A::from(translation);
383+
if let Some(mat3x3) = result.get_instance::<TransformMat3x3>(resolver, 0) {
384+
transform *= glam::Affine3A::from(mat3x3);
385385
}
386386

387387
let transform_relation = result

crates/viewer/re_viewer/src/reflection/mod.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/reference/types/archetypes/transform3d.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rerun_cpp/src/rerun/archetypes/transform3d.hpp

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rerun_py/rerun_sdk/rerun/archetypes/transform3d.py

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)