pichou Posted October 11, 2018 Share Posted October 11, 2018 I am sure the problem is already solved somewhere and well known but I can't find a working solution. I have a sphere with planes around it and I need those planes to be tangent to the sphere depending on its position. I have made a playground with my basic setup: https://www.babylonjs-playground.com/#VDG184#2 You will see 2 solutions I tried but which are not working, one using path3D and one with basic math. Thank you, Pichou Quote Link to comment Share on other sites More sharing options...
ssaket Posted October 12, 2018 Share Posted October 12, 2018 Hi there ! you can change the segment of the sphere to decided on number of planes. The solution uses facets normals- https://www.babylonjs-playground.com/#VDG184#7 Good day jerome, kcoley, pichou and 1 other 3 1 Quote Link to comment Share on other sites More sharing options...
pichou Posted October 12, 2018 Author Share Posted October 12, 2018 Hi @ssaket, I needed to keep my latitude longitude approach but thanks to your suggestion, I managed to get the right formula: https://www.babylonjs-playground.com/#VDG184#9 Thanks, I didn't know about the alignWithNormal function but very useful! Cheerz ssaket 1 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.