diff --git a/examples/20_scene_pointer.py b/examples/20_scene_pointer.py index 1069c302..6d5a2e90 100644 --- a/examples/20_scene_pointer.py +++ b/examples/20_scene_pointer.py @@ -71,7 +71,7 @@ def _(event: viser.ScenePointerEvent) -> None: client.scene.remove_pointer_callback() # Get the first hit position (based on distance from the ray origin). - hit_pos = min(hit_pos, key=lambda x: onp.linalg.norm(x - origin)) + hit_pos = hit_pos[onp.argmin(onp.sum((hit_pos - origin) ** 2, axis=-1))] # Create a sphere at the hit location. hit_pos_mesh = trimesh.creation.icosphere(radius=0.1)