HunsingerUK Posted March 1, 2015 Share Posted March 1, 2015 Hi everyone, I'm relatively new to babylon js. I'd like to make a space environment that has many star meshes. I'd like for each star to have a default size but if the camera gets close enough to the star, increase the size of that star. I can create the environment with many stars just fine. My initial attempts at adding a prototype function, to my star type, to do this isn't working. Any advice to point me in the right direction would be appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
davrous Posted March 1, 2015 Share Posted March 1, 2015 Hi, You can use the getDistanceToCamera() function on your meshes for that. Out of curiosity, why would you like to code such behavior?Bye,David HunsingerUK 1 Quote Link to comment Share on other sites More sharing options...
HunsingerUK Posted March 1, 2015 Author Share Posted March 1, 2015 Thanks David, Each of the stars in my star class have planets, and animation, and then each of the planets will have the possibility to have moons and/or rings. But at a distance, I think that all of that (planets, animations, etc...) would be pointless to have going because I'm not going to be able to see them and it will just waste performance - that's my thought at least. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 2, 2015 Share Posted March 2, 2015 I would love to see the result when it will be done HunsingerUK 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.