Creating celestial bodies?

I am trying to create a space station in orbit around earth. The space station will be the main level but I want to create the backdrop of space, the earth, the moon and possibly the sun. How do you go about creating these?

First ask yourself question if you want accurate motion, or just something like it. Then either google for orbit parameters, or just write down orbit distances, and relative sizes of moon and earth. There are also plenty of textures for moon and earth, then you need milky way texture. Polar coordinate texture for skybox will look best, but those are huge, and you need some work to make one.

Now back to celestial bodies.
Make blueprint that spins earth around sun, then moon around earth. You need a bit of vector math. To make circle you need vector of [1,0,0] multiply it by orbit distance then rotate by angle (that you interpto from 0 to 360, and loop).
So you have single planet/moon motion relative to its center of orbit.
Sun does not move, so you can just place it in middle.
Then place earth on suns orbit. Find earths location on orbit, add to it suns location (which is [0,0,0]). Earth orbits sun. Easy
Now same with moon. Find its location on orbit, add to it earths location. You get moon orbiting earth which is orbiting sun.

But your game is around space station which is orbiting earth. You do same code for it as you did for moon. Problem is that it will “escape” your spaceship.

To get it correct and center gameplay around space station, you need to recalculate relative locations. It may look a bit tricky, but its simple vector math.

For each celestial body (ie sun, earth, moon, spacestation) substract your focus location (in this case space station) from celestial body location. This is new location of them in your now centered around space station universe.

Since it’s a backdrop, you will need skills in compositing, matte painting, skybox creation, etc.

Your question is too open ended, like asking how to go about building a car.

Some tips:

  • check out NASA for excellent and hi res imagery of space
  • use hi res space imagery to comp your background in something like photoshop/after effects
  • you can paint your own imagery if you are a good artist

good luck with your game!

Man you guys are awesome. This forum is absolute gold. There is so much good information on here. Thanks for the guidance.