Jump to content
  • Advertisement
Sign in to follow this  
Ebola0001

best way to make something orbit

This topic is 3634 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok here is my question... I have a starfield that has 300 or so stars put in random positions within a cube of space. I want to place planets orbiting those stars. I see two ways of doing this, 1) Modifying the world matrix Normal world matrix for stars Scale*Rotate*Position Planet Matrix Scale*Rotate*OrbitDistance*OrbitRotation*Position 2) Calculating the position externally and just updating its position manually Planet Position X = (Cos(OrbitRotation)*OrbitDistance)+StarPositionX Planet Position Y = (Sin(OrbitRotation)*OrbitDistance)+StarPositionY Planet Position Z = (Sin(OrbitRotation)*OffPlane)+StarPositionZ or somesuch both of these should yield an orbit, would there be an atvantage to one over the other? oh I should also say I have experimented with dynamic orbit with gravity but it takes alot of tuning to get a stable orbit. [Edited by - Ebola0001 on August 10, 2008 4:43:54 PM]

Share this post


Link to post
Share on other sites
Advertisement
I'd recommend option (2) for its simplicity, especially since it doesn't incur any speed or efficiency penalties over that of (1). With the second, your planets' coordinates are already in universe-space, so I suppose it can save you some recalculation.

And yes, if you don't want a true physics simulation, then don't create one.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!