narkro555 Posted September 14, 2018 Share Posted September 14, 2018 Simply put, I would like to fire a ray straight out of the player's view. Sort of if as to fire a bullet down the screen's centered crosshairs, but instead to instantly pick the first mesh the beam hits. I'm bad at vector math, and haven't been able to piece anything together after a lot of experimenting and searching. Could someone lend a hand? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted September 14, 2018 Share Posted September 14, 2018 Luckily you don't need to know any vector math Here is a PG: https://www.babylonjs-playground.com/#45W3XB#1 Quote Link to comment Share on other sites More sharing options...
narkro555 Posted September 14, 2018 Author Share Posted September 14, 2018 13 minutes ago, brianzinn said: Luckily you don't need to know any vector math Here is a PG: https://www.babylonjs-playground.com/#45W3XB#1 Oh wow how did I not see that. Thank you very much, I hope others who search this query will find this answer too. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted September 14, 2018 Share Posted September 14, 2018 No need to even create the getFacetData as it is now part of the framework: https://www.babylonjs-playground.com/#45W3XB#2 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted September 14, 2018 Share Posted September 14, 2018 @Deltakosh - I couldn't find that in source and my PG fails with "pickResult.pickedMesh.getFacetData is not a function" Quote Link to comment Share on other sites More sharing options...
Guest Posted September 17, 2018 Share Posted September 17, 2018 Sorry for some reasons I pointed out the wrong PG Correct one: https://www.babylonjs-playground.com/#45W3XB#3 Doc: http://doc.babylonjs.com/how_to/how_to_use_facetdata 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.