From fc363ae46844b2021b7b6fceaca23e59807c81a5 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Fri, 31 Mar 2023 18:58:51 +0200 Subject: [PATCH 1/3] Double half-size when going to size. --- rerun_py/rerun_sdk/rerun/log/bounding_box.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rerun_py/rerun_sdk/rerun/log/bounding_box.py b/rerun_py/rerun_sdk/rerun/log/bounding_box.py index 2e1ef6b50b26..10bab1acb438 100644 --- a/rerun_py/rerun_sdk/rerun/log/bounding_box.py +++ b/rerun_py/rerun_sdk/rerun/log/bounding_box.py @@ -72,7 +72,7 @@ def log_obb( splats: Dict[str, Any] = {} if half_size is not None: - size = np.require(half_size, dtype="float32") + size = np.require(half_size, dtype="float32") * 2.0 if size.shape[0] == 3: instanced["rerun.box3d"] = Box3DArray.from_numpy(size.reshape(1, 3)) From f418373bf2969f4ff47745eae12baa5e68f2fca3 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 1 Apr 2023 09:06:09 +0200 Subject: [PATCH 2/3] Revert "Double half-size when going to size." This reverts commit fc363ae46844b2021b7b6fceaca23e59807c81a5. --- rerun_py/rerun_sdk/rerun/log/bounding_box.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rerun_py/rerun_sdk/rerun/log/bounding_box.py b/rerun_py/rerun_sdk/rerun/log/bounding_box.py index 10bab1acb438..2e1ef6b50b26 100644 --- a/rerun_py/rerun_sdk/rerun/log/bounding_box.py +++ b/rerun_py/rerun_sdk/rerun/log/bounding_box.py @@ -72,7 +72,7 @@ def log_obb( splats: Dict[str, Any] = {} if half_size is not None: - size = np.require(half_size, dtype="float32") * 2.0 + size = np.require(half_size, dtype="float32") if size.shape[0] == 3: instanced["rerun.box3d"] = Box3DArray.from_numpy(size.reshape(1, 3)) From 9f39b787c861d6eec68a579ec012c49bed0d938d Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 1 Apr 2023 09:16:08 +0200 Subject: [PATCH 3/3] set to twice to be used by transform. --- .../re_viewer/src/ui/view_spatial/scene/scene_part/boxes3d.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/re_viewer/src/ui/view_spatial/scene/scene_part/boxes3d.rs b/crates/re_viewer/src/ui/view_spatial/scene/scene_part/boxes3d.rs index 9a4cc28388b6..6411a9ca0b90 100644 --- a/crates/re_viewer/src/ui/view_spatial/scene/scene_part/boxes3d.rs +++ b/crates/re_viewer/src/ui/view_spatial/scene/scene_part/boxes3d.rs @@ -64,7 +64,7 @@ impl Boxes3DPart { let color = annotation_info.color(color.map(move |c| c.to_array()).as_ref(), default_color); - let scale = glam::Vec3::from(half_size); + let scale = glam::Vec3::from(half_size) * 2.0; let rot = rotation.map(glam::Quat::from).unwrap_or_default(); let tran = position.map_or(glam::Vec3::ZERO, glam::Vec3::from); let transform = glam::Affine3A::from_scale_rotation_translation(scale, rot, tran);