Jump to content

multipick mesh


ua4192
 Share

Recommended Posts

Dear all.

I have a small problem with my code.

I want to select one of the multiple invisible but pickable meshes with the mouse. The goal is that I have a big model GLTF (assembly) loaded in the scene, but I also have the boxes of the parts contained loaded in the scene. The idea is that as in a typical CAD program be able to select on of the boxes (the closest one from the coordinates selected with the mouse in the assembly)

In the scene I will load the GLTF contained meshes and the boxes (bounding boxes) of the parts in these meshes in a invisible but pickable way.

I am using this approach because loading thousand of gltfs of parts is unachievable, the browser gets hang. Instead I load some big GLTFS and I want to be able to get metadata information from the parts contained in this assemblies.

When I click with the mouse on the scene, I want to take the coordinates of the big assembly (GLTF) and make visible the box of the closest box of these coordinates.

I am trying to use a raycast with camera position and mouse coordinates but it seems that multipick is not able to pick invisible boxes. I have also some problems to set the direction vector of the raycast based on the selected mouse coordinates and camera position.

Many thanks in advanced for your support.

Link to comment
Share on other sites

My idea is to make a raycast using the camera position and mouse picked coordinates, then use the multipick function to get all meshes which collide with this coordinates(mouse selected) and finally take the closest one (the last retrieved bounding box before the GLFT mesh).

It seems that multipick doesn't work when meshes (my bounding boxes are not visible but pickable).

 

Many thanks

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...