Rajkumar Posted March 17, 2016 Share Posted March 17, 2016 Hi, I drew a line and then tried to pick the same. This however does not work as expected. Please find below, link for the trial. http://www.babylonjs-playground.com/#1I4F1D#1 Kindly let me know where I am going wrong. Regards Rajkumar Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 17, 2016 Share Posted March 17, 2016 Hello! I'm afraid lines are not pickable Quote Link to comment Share on other sites More sharing options...
Rajkumar Posted March 17, 2016 Author Share Posted March 17, 2016 oh ! We are planning to develop a component where in user should be able select edges for welding operation. I was thinking that all edges would be rendered as line and then ask the user to pick whatever is needed. If lines are not pickable, what is the alternative for my case ? Should I create small planes instead of lines ? Wont this have performance issues ? Kindly suggest a way to achieve this effect. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 17, 2016 Share Posted March 17, 2016 Hello! I guess the best option would be to add support for picking on lines. Quote Link to comment Share on other sites More sharing options...
Rajkumar Posted March 18, 2016 Author Share Posted March 18, 2016 Can you please help to add support for this in babylon.js ? Quote Link to comment Share on other sites More sharing options...
adam Posted March 18, 2016 Share Posted March 18, 2016 You might want to use createTube. http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#tube Quote Link to comment Share on other sites More sharing options...
Rajkumar Posted March 26, 2016 Author Share Posted March 26, 2016 @Deltakosh Looks like this is addressed now. Thank you, picking on Lines works now ! http://www.babylonjs-playground.com/#1I4F1D#2 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 26, 2016 Share Posted March 26, 2016 Waaaowww, who did this ? I couldn't even see the related PR Quote Link to comment Share on other sites More sharing options...
adam Posted March 26, 2016 Share Posted March 26, 2016 I think it was https://github.com/nockawa https://github.com/BabylonJS/Babylon.js/commit/6b40c50f585e508fa9a03b85fd3cf169e8f9f568 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 26, 2016 Share Posted March 26, 2016 Friggin' Noxy (Nockawa), sneakin' around doing excellent contribs. He also did http://doc.babylonjs.com/tutorials/Using_parallax_mapping Did he think we wouldn't notice? *sigh* The Gods make it look SO easy. (drooool) Someday. Someday I'll walk with the Gods, or at least be allowed to sweep their floors and wash their laundry. heh Quote Link to comment Share on other sites More sharing options...
Rajkumar Posted April 2, 2016 Author Share Posted April 2, 2016 @Nockawa , thank you for your quick support. I would like to pick the lines mesh even though mouse is not very precisely over the mesh. looks like intersectionThreshold should take care of this, however I think I am missing something. please refer http://www.babylonjs-playground.com/#1I4F1D#6 What should be done to pick with some tolerance ? Quote Link to comment Share on other sites More sharing options...
Nockawa Posted April 3, 2016 Share Posted April 3, 2016 I'm in a trip right now, I'll takea look in few hours. but yes the bigger is the tolerance the easier it is to pick the wire line. The tolerance is in world coordinate. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted April 3, 2016 Share Posted April 3, 2016 @Rajkumar I've got some time to spend on your issue, here's what happens, there're two things: 1) The boundingInfo of you line mesh exactly fits the line, there's no "additional margin" so your mesh is rejected if the mouse pointer is too far. In another words, the engine doesn't make the linesMesh intersection because the ray corresponding to the mouse cursor is outside the boundingInfo of the lineMesh. That is why I've created a boundingBias property in the Geometry class: to "extend" the bounding info using a 2D vector with the formulae described in the doc: The Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y 2) Unfortunately I've discovered a bug when trying to fix your issue, the boundingInfo is not updated when you change the boundingBias after the linesMesh is created. I've just fixed the bug and will submit a PR right away. Hoping @Deltakosh will integrate it and update the playground quickly. The only line you'll need to add is: xaxis.geometry.boundingBias = new Vector2(0, 100); btw, you'll see that 100 is overkill, setting 1 is totaly acceptable in your case. Best, Nockawa RaananW and adam 2 Quote Link to comment Share on other sites More sharing options...
Rajkumar Posted April 4, 2016 Author Share Posted April 4, 2016 @Nockawa Thank you very much for solving this. Nockawa 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 4, 2016 Share Posted April 4, 2016 it should be online 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.