Skip to content

Add object picking via OptiX single-ray raycasts#54

Merged
brendancol merged 1 commit intomasterfrom
feature/object-picking
Feb 24, 2026
Merged

Add object picking via OptiX single-ray raycasts#54
brendancol merged 1 commit intomasterfrom
feature/object-picking

Conversation

@brendancol
Copy link
Contributor

@brendancol brendancol commented Feb 23, 2026

Summary

  • Add RTX.pick(origin, direction) method that fires a single OptiX ray and returns hit info (geometry ID, position, normal, primitive/instance IDs)
  • Add _screen_to_ray() to InteractiveViewer for window-to-world ray conversion
  • Right-click in the interactive viewer now picks geometry and prints hit info to the terminal
  • Add ViewerProxy.pick(screen_x, screen_y) for programmatic picking from the REPL (v.pick(400, 300))
  • Add help text entry for right-click picking

Test plan

  • Run an explore session with placed geometry (e.g., buildings) and right-click on objects to verify geometry ID, position, and primitive info are printed
  • Right-click on terrain to confirm it reports 'terrain' as geometry ID
  • Right-click on sky (miss) to confirm "no geometry hit" message
  • Test REPL access via v.pick(400, 300) and verify returned dict
  • Run existing tests: pytest rtxpy/tests/test_simple.py -k instance_ids

Add RTX.pick() method that wraps trace() for single-ray picking, returning
geometry ID, hit position, normal, and primitive/instance IDs. Add
_screen_to_ray() to InteractiveViewer for window-to-world ray conversion,
right-click picking in the interactive viewer, ViewerProxy.pick() for REPL
access, and help text entry.
@github-actions github-actions bot removed the GPU CI label Feb 23, 2026
@brendancol brendancol merged commit 2aaed07 into master Feb 24, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant