ua4192 Posted July 19, 2017 Share Posted July 19, 2017 Hi. I have a problem when trying to pick meshes from an imported mesh (GLTF 1.0 file). My problem is that scene.pick method is returning null always. Only when I am very close to the mesh I am able to pick the mesh but always the same mesh. I have read other posts from other people having the same problem, but not sure about the solution. In my example I am not transforming anything (moving neither rotate), just loading the GLTF that contains submeshes inside (in the inspector you can see the product structure of the GLTF) but not able to pick anything. I am using BABYLONJS 3.0. Any clues? Best regards Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 19, 2017 Share Posted July 19, 2017 Can you make sure that your mesh (only one mesh?) is set with mesh.isPickable = true ? Quote Link to comment Share on other sites More sharing options...
ua4192 Posted July 20, 2017 Author Share Posted July 20, 2017 Yes. I am sure that all meshes in the GLTF file are Pickable, Visible and Enabled. When I import the GLTF file I set all meshes contained with these settings. This was my first thought. And I checked it by putting a trace for each mesh contained in the GLTF. In deed, It is really strange but picking works but only when I am very close to the mesh. The mesh exceeds the frustum. When I zoom out it doesn't work. Best regards Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 20, 2017 Share Posted July 20, 2017 Ok, this may be a bug but I need a repro case on the playground Quote Link to comment Share on other sites More sharing options...
ua4192 Posted July 21, 2017 Author Share Posted July 21, 2017 Hi. Here you can see: http://www.babylonjs-playground.com/#QG91RX#4 In theory when mouse was over the mesh it should display the name and point 3D coordinates and also change the color. You will see that coordinates are always (NaN, NaN, NaN) and the mesh is not properly recognized and that color is not properly changed, just some meshes are recognized. It is really a bug in my opinion. It happens with all models I have tested. Best regards Quote Link to comment Share on other sites More sharing options...
max123 Posted July 21, 2017 Share Posted July 21, 2017 Could it be meshes' coordinates/transforms? E.g. it is strongly advisable to freeze all objects when you export from Blender (apply transformations). Quote Link to comment Share on other sites More sharing options...
ua4192 Posted July 21, 2017 Author Share Posted July 21, 2017 Thanks for your response. I finally found the issue. The problem was my scene and camera settings Best regards 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.