Search - User list
Full Version: pxr.Gf.Ray intersection with bounding box.
Root » Solaris and Karma » pxr.Gf.Ray intersection with bounding box.
aaronauty
I am writing a python state in a lop node that needs to raycast into the scene viewer.

I can't find anything in stateutils to assist with this, so I am rolling my own, and am having issues getting GfRay to work as expected.

  • I have constructed a GfRay passing in two vectors for start/end.
  • I have constructed UsdGeomBBoxCache's for the prims on the stage.
  • I am calling the GfRay's Intersect method, and passing in a GfRange3d, as the signature does not support a UsdGeomBBoxCache. I am calling ComputeAlignedBox on the UsdGeomBBoxCache's to get the GfRange3d.

The intersection seems to return true no matter where I position my start/end vectors.

hip file attached to demonstrate what I am trying to achieve outside of the state.

Cheers,
Aaron.
aaronauty
I was able to solve this using sop verbs to build the hou.Geometry() object from the UsdGeomBBoxCache's , and use the stateutils.sopGeometryIntersection method.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB