Celga Posted June 27, 2017 Share Posted June 27, 2017 Hi, I use the event pointermove on my canvas, in a application (web site), in which I import meshes with files .babylon. These files have been created from 3ds max. I have some difficulties to retrieve the picked mesh, especially when I pick these imported meshes. In most cases, I'm not able to have a result, for the picked mesh. The aim is to use touch events, in order to pick some interactive areas, revealing videos or other imported meshes, for a use of device mobile and tablets For informations, the application works correctly, on pc, on several browsers. Here is the function with the event pointermove : canvas.addEventListener("pointermove", function(evt) { pickTouchResult = scene.pick(scene.pointerX, scene.pointerY); alert("Pointer MOVE (canvas)"); alert(pickTouchResult.pickedMesh.name); alert("evt.pointerType : " + evt.pointerType); }); If you have some suggestions, I thank you in advance. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 27, 2017 Share Posted June 27, 2017 Are your meshes pickable (mesh.isPickable = true) or otherwise use the 3rd parameter of scene.pick, which is a predicate (and also camera, in case you have multiple viewports/cameras). https://doc.babylonjs.com/classes/2.5/scene#pick-x-y-predicate-fastcheck-camera-rarr-pickinginfo-classes-2-5-pickinginfo- JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
Celga Posted June 28, 2017 Author Share Posted June 28, 2017 Thanks a lot for your answer and for your advice. Indeed, I used mesh.isPickable = true on the meshes imported. But, I only put it with the camera used for pc. I changed my condition and It seems to be good, on tablet device. Meshes are picked correctly, with touch :).. My mistake. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.