Search the Community
Showing results for tags 'dragndrop'.
-
Hi, I would like to pick a mesh and moving it around a room which is a simple cube with backside orientation. Basically, it consists on 3 functions called on 3 distinct events onPointerDown : I select the mesh I want to move (main mesh) when I click on the mouse onPointerMove : I select a different mesh in order to move the main mesh when I drag the mouse onPointerUp : I deselect the main mesh when I release the click of the mouse The behavior I want to produce is to dragndrop the main mesh on visible faces only and keeping each face belonging to the same mesh (I don't want to create as many meshes as faces). For instance, when my camera is above the room, the ceiling is transparent and we can see the floor due to the backside orientation of the room. But on step 2, I can't figure out how to pick the face which corresponds to the floor. I only succeed to pick the ceiling. I tried to build a predicate (pickInfo = scene.pick(x,y,predicate)) based on faces normales but once a mesh has been evicted from the predicate, it is not recalled, even if more than one face which is intersected. So I would like to know if there is a way to do what I'm expecting to do. When a mesh has succeed the predicate, how the returned pickInfo is built ? The selected face (pickInfo.pickedPoint) is always the nearest from the camera ? Is is possible the return an array of valid meshes with an another array containing its corresponding faces intersected ? Here is a PG relating my issue : http://www.babylonjs-playground.com/#1V3CAT#185 Thanks
- 2 replies
-
- dragndrop
- mesh picking
-
(and 2 more)
Tagged with:
-
Guys, i've got scene.pick problems using two cameras. Here is the demo of the problem http://www.babylonjs-playground.com/#M3K0C I added another camera and "scene.pick" stop working well set "cameraToUseForPointers" to playerCamera dont help. What I miss?