简体   繁体   中英

Seed generated 3d points in space for space simulation

I am interested in generating a star system that uses seed-based randomized points in 3d space so that if the rendered point would move, the points in space would remain in their relative position from the global origin, effectively creating the illusion of a pre-seeded universe.

I have looked at previous solutions and the recommended Poisson Spheres which generates random positions incrementally but isn't ideal for the core purpose even though I would benefit from a minimum distance between all points, this can be done by simply snapping the points to a grid and using a random seed to offset them based on world space.

Using something like 3d noise to reduce density is also an option but I suspect doesn't hit the core issue of creating single points if the algorithm simply finds the brightest peak in the 3d space when you want multiple potentially in an area.

Ideally, being able to control the density with 3d noise would be a benefit.

The end result would be a system where feeding a random string populates a larger seed that populates 3d points that are referenceable by an ID based on its render parameters, allowing those items to be found again based on its Vector 3 location from global origin

Research:

Found a solution: Using the Origin of the players reference and the relative offset from the grid, you search nearby "points" on the X, Y, Z.

You store these points as a key name in some sort of index or database, in my case a Vector3Int as a dictionary key.

When iterating through the above loop, you ensure the key does not exist in the dictionary already.

I repeated this process for 'cells' and then again for 'stars' inside the area

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM