bar10dr Posted September 16, 2018 Share Posted September 16, 2018 Hi, I'm trying to make a planet rotate around itself, and at the same time rotate around a sun. I do not want to use the sun's rotation to rotate the planet, as it will look strange if the sun is rotating when I apply textures to it. I made a little example with two cameras that switches every five seconds to convey my problem; as you can see I get the planet to rotate around the sun, but it does not rotate around its own axis. http://www.babylonjs-playground.com/#6WAD41 A push in the right direction would be appreciated :) Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 16, 2018 Share Posted September 16, 2018 Hi bar10dr, welcome to the forum. Sometimes people position an invisible box/plane inside the sun... as a parent for the orbiting things. Then the sun can rotate however it chooses, and so can the orbiters. If there are many orbiting planets at different orbit speeds, then you can make a separate invisible "orbit pivot" for each planet. http://www.babylonjs-playground.com/#6WAD41#1 Does that look better? There may be other ways to do it, but invisible planet-parents work pretty well. Each planet-parent can rotate a tiny amount, too, so you can have non-equatorial orbit paths. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
bar10dr Posted September 16, 2018 Author Share Posted September 16, 2018 Ah of course, should have thought about that. Thank you! Wingnut 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.