Monday, November 5, 2018

c++ - Procedural star field generator


Is anyone aware of any code to procedurally generate star fields?


Ideally I'd like it to be physics-based so I can have realistic planets and moons. Best would be in C++, open source, and workable with Ogre3d.


I'm not afraid of coding something from a university paper if there's nothing available.



Answer



I believe that producing a star field (long range) and planets and moons ("short range") should be two different layers. As for the star field, I've found this to be useful for my game: http://alexcpeterson.com/spacescape. That can take care of your long range, static star field. It's written in C++ and open source.


As for the "short range" stuff. I've found some sources for solar system simulators, but from my shallow glance, they don't look very generic, if you're wanting to create a different solar system than our own. I put the links at the end.


In reality this shouldn't be too difficult of a task to create a generic system for planets. Study up on your Kepler and you can get some good estimations of planet positions. http://en.wikipedia.org/wiki/Kepler%27s_laws_of_planetary_motion. Probably just stick with simple non-eccentric orbits to start :)



Here's some links for solar system simulators I found.


http://astro.berkeley.edu/~dperley/programs/ssms.html


http://code.google.com/p/solar-system-cpp/


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...