mangomongo Posted April 28, 2017 Share Posted April 28, 2017 When a sphere is clicked I want to place an object on the surface of the sphere where the sphere is clicked. I have a playground that places an object at a random point on the surface when the sphere is clicked: http://www.babylonjs-playground.com/#AV08NV Can someone update the unitX, unitY and unitZ vars on lines 33-35 so that they reflect the point on the sphere that was clicked instead of random? These unit x, y and z values are between 0-1. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 28, 2017 Share Posted April 28, 2017 Something like that? http://www.babylonjs-playground.com/#AV08NV#1 Quote Link to comment Share on other sites More sharing options...
mangomongo Posted April 28, 2017 Author Share Posted April 28, 2017 Hey thanks, it's a bit off though. I forgot to mention that you can use the arrow keys to rotate the sphere. So you need to take the rotation into consideration when finding the point. And when you rotate the big sphere all the little white markers should rotate with the whole sphere. So I think you need to attach the white markers to the sphere using their parent property like I did in my playground. Quote Link to comment Share on other sites More sharing options...
Gijs Posted April 29, 2017 Share Posted April 29, 2017 Here it is: http://www.babylonjs-playground.com/#AV08NV#2 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
mangomongo Posted April 29, 2017 Author Share Posted April 29, 2017 awesome, thanks! 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.