Star locations in a galaxy.

Started by
9 comments, last by DavidJamesRobinson 12 years, 11 months ago
Hi,

I'm searching for some reading material about how stars are positioned inside different types of galaxies.
My ultimate goal is to create a procedural galaxy generator, but to do so I first have to understand the physics behind galaxies.
I don't really need a physically correct galaxy though, I just want something that looks good, so I welcome any other suggestions on this matter as well.

Cheery,
Hyu
Advertisement
In a spiral galaxy they're in the arms so I'd probably start by generating a graph with a center and a random number of arms. Then generate more stars at the beginning of arms and less as you go to the ends. The spiral galaxy wikipedia article has pictures.

Also ysaneya on the forums did what you might want already. Might give you some inspiration.

His octree method is probably the best idea.
I'd do like the previous poster said. Just hard-code the basic types of generation algorithms like spiral, barred spiral, elliptical, etc. Randomly generate based on a few parameters.

Trying to model actual physics is far more complex than you're gonna need. Getting into density waves and such is overkill if you just want it to look like a galaxy.
Quote:Original post by sporff
I'd do like the previous poster said. Just hard-code the basic types of generation algorithms like spiral, barred spiral, elliptical, etc. Randomly generate based on a few parameters.

Trying to model actual physics is far more complex than you're gonna need. Getting into density waves and such is overkill if you just want it to look like a galaxy.


Plus (a few years ago, at least) the physics is not even fully understood of all types. I mean, okay gravity, but some of the shapes weren't described well.

This statement definitely needs clarification.
Thank you for the replies.
I always thought ysaneye did his generation physics based, however, in his dev journal he states:
Quote:To generate the spiral arms, the probability is looked up from a "density map" ( similar to a grayscale heightmap ).


So basically, I'll need a density map for each type of galaxy I want to use first. (which I can either base on imagery of real galaxies, or generate it procedurally as well)
Then I will need a function that calculates the density for a given position, using the density map, the distance to the center of the galaxy, the distance to the closest globular cluster etc...
The density then tells me how likely it is that a star is in this location.

I can then create stars at random positions, test them against the density, and add the ones that pass a probability test to the scene.

Am I on the right track?
Sounds good so far, so I'll probably go with that.

Thanks for the help!
Hyu
I read somewhere that the increased stellar activity (e.g. supernovae) in the spiral arms may sterilize planets on a regular basis. The Solar System is in one of those darkish regions between the arms. You could have the generator put all the alien civilizations in the dark regions to make the map less homogenous. Homogenity is boring.
Quote:Original post by Hyunkel
I can then create stars at random positions, test them against the density, and add the ones that pass a probability test to the scene.


You might be better off testing a uniform grid of positions against the density and only use the randomness in generating the density map. This should give you more control on how many stars actually appear in the scene; with random positions you'll have extreme cases where there simply are no stars at all. Another plus is that it should give you repeatable results; a given density map will always look the same, which is probably a good thing if your player decides to visit a galaxy again at some later point in time.

For some random rambling, it might be surprising to see how many stars actually make up a galaxy. The number in our galaxy alone goes into the hundreds of billions. In a little toy project, I've rendered 100k well known (and prominently visible) stars surrounding earth from astronomical data and this already looks quite crowded, but it doesn't even approach looking like a faint outline of a spiral arm. I just find this fascinating, but it also might be somewhat useful to keep in mind when determining the scale and the desired accuracy of your simulation.


[Edited by - remigius on October 12, 2010 3:06:08 AM]
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Hey remigius,

Thanks for your input.
After some initial testing I quickly realized that seeding with random points is a bad idea.
A uniform grid such as you suggested works much better, and it is also much easier to create a galaxy that looks the same way every time you visit it.

As for the total amounts of stars, yes, it's crazy.
I'm not really sure how high I want to go yet.
I suppose I'll either go with a much lower number, or I'll use some sort of culling based on the distance and size of the stars.

We'll see, at first I want to get it to look decent, and I'll just go from there :)
Quote:Original post by JoeCooper
I read somewhere that the increased stellar activity (e.g. supernovae) in the spiral arms may sterilize planets on a regular basis. The Solar System is in one of those darkish regions between the arms. You could have the generator put all the alien civilizations in the dark regions to make the map less homogenous. Homogenity is boring.


Sol lies smack in the middle of the Orion arm, actually. This web page has some rather interesting maps showing our surroundings. One of the more interesting on it is this 2kly Sol neighbourhood one, which shows some of the macrostructure of the arm - in particular, the nearly empty dark "bubbles" of space thought to be places where supernovae exploded and pushed other star systems away.
I've experimented with uniform grids a bit, but I've run into a bit of trouble.

It works very well together with density testing, but the grid structure remains visible unless the max density is very low ( below 0.5% ).

So if I want a total of 100k stars for example, I need to create a grid containing over 20 million points.
This is obviously quite slow to compute.
I'm not really sure what the best approach is to tackle this problem.

I'm playing with the idea of using a non-uniform grid, but I'm a bit afraid of running into problems at a later time.


Just wondering if anyone has another idea how to approach this?

Cheers,
Hyu

This topic is closed to new replies.

Advertisement