Jump to content

Picking Bounding Boxes


Art Vandelay
 Share

Recommended Posts

Hi,

Is there anyway to pick a bounding box? I know I can pick a mesh using scene.pick but then pickInfo.pickedPoint will give me the point where the picking ray hit the mesh. What I would like to get is the point where the picking ray hit the bounding box of the mesh. How can I do that?

Thanks!

Link to comment
Share on other sites

Hi Art Vandelay !

There may be a more efficient way to do, but here is a solution :

  • Create a real mesh from your bounding box data (you will find in THIS post how to do it)
  • Disable this mesh to avoid unnecessary computation and to be sure it is not drawn
  • Change the predicate function on your picking method to ensure you pick only 'MeshBuildFromBoundingBoxData' (you might use Tags if you have many meshes/bounding box in your scene)

This way you will get the wanted intersection point !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...