I'm trying to create a shelf tool where the user can click anywhere on viewport and will create a ray that shoots into the screen and detects any intersection with primitives.
I'm using sceneViewer().selectPositions() (to get a point in 3d space) and sceneViewer().curViewport().viewTransform() to get a normal from the viewport camera but the math doesn't work out. are there any functions in the HOM that allow me to more easily do this?
Using the UI to select a coordinate on primitives
1763 2 0- omgeric
- Member
- 48 posts
- Joined: 2月 2013
- Offline
- edward
- Member
- 7768 posts
- Joined: 7月 2005
- Offline
Have you tried queryPrimAtPixel() ? However, I think you might need to be at the SOP level to do this.
http://www.sidefx.com/docs/houdini12.5/hom/hou/GeometryViewport#queryPrimAtPixel [sidefx.com]
http://www.sidefx.com/docs/houdini12.5/hom/hou/GeometryViewport#queryPrimAtPixel [sidefx.com]
- omgeric
- Member
- 48 posts
- Joined: 2月 2013
- Offline
edward
Have you tried queryPrimAtPixel() ? However, I think you might need to be at the SOP level to do this.
http://www.sidefx.com/docs/houdini12.5/hom/hou/GeometryViewport#queryPrimAtPixel [sidefx.com]
i already solved my problem, but thanks that looks interesting.
-
- Quick Links