So I’m trying to make a space simulator type of game for a school project and I’m having a problem with the camera. In my game, you control a spaceship and fly around the solar system. Everything works fine except that the planets are so big compared to the player that they do not show up on screen. You can only see them if you position the camera so that the planet is on the edge of the screen. I have tried changing the near and far clipping values but nothing seems to work.
Thank you!
(Sorry if this isn’t the right place to post this thread, I didn’t see anywhere that was more specific to my problem)
Cameras see a frustum, by default a pyramid shape on its side about 1 kilometer long.
Put a primitive sphere in at (0,0,0) and the camera at (0, 1, -10) default, then the limit of what that camera can see is at about (0,0,990). Anything further than that is out of frustum.
A 1x1x1 sphere at (0,0,90) is almost invisible from the above camera position. It’s a few pixels across.
If you’re trying to model the actual solar system to scale, the planets are going to be incredibly tiny relative to the spaces between them.
Due to floating point limitations, you will not practically be able to put planets millions of kilometers apart, at least not without implementing something like a floating origin and imposters.
The traditional approach to space flight sims is to scale up the planets and move them much closer to each other and come up with something fun that way.