¿Cómo generar los bosques en java

Coder al azar:

Estoy createing un juego en el que se genera un paisaje todas las generaciones funcionar perfectamente, hace una semana he creado un sistema básico de 'bosque' generación wich simplemente es un bucle que se lleva un trozo, y lugares cantidades aleatorias de árboles en lugares al azar . Pero eso no da el resultado que me gustaría lograr una.

Código

for(int t = 0; t <= randomForTrees.nextInt(maxTreesPerChunk); t++){

    // generates random locations for the X, Z positions\\
    // the Y position is the height on the terrain gain with the X, Z coordinates \\
    float TreeX = random.nextInt((int) (Settings.TERRAIN_VERTEX_COUNT + Settings.TERRAIN_SIZE)) + terrain.getX();
    float TreeZ = random.nextInt((int) (Settings.TERRAIN_VERTEX_COUNT + Settings.TERRAIN_SIZE)) + terrain.getZ();
    float TreeY = terrain.getTerrainHeightAtSpot(TreeX, TreeZ);

    // creates a tree entity with the previous generated positions \\
    Entity tree = new Entity(TreeStaticModel, new Vector3f(TreeX, TreeY, TreeZ), 0, random.nextInt(360), 0, 1);

    // checks if the tree is on land \\
    if(!(tree.getPosition().y <= -17)){
        trees.add(tree);
    }

}

Resultado

Imagen con el resultado de la generación de código básica anterior visto

Si conoce alguna manera de que pudiera generar bosques más realistas por favor hágamelo saber que me ayudaría mucho.

Gracias por adelantado

rango:

En primer lugar echar un vistazo a mi:

as you can see you can compute Biomes from elevation, slope, etc... more sophisticated generators create a Voronoi map dividing your map into Biomes regions assigning randomly (with some rules) biome types based on neighbors already assigned...

Back to your question you should place your trees more dense around some position instead of uniformly cover large area with sparse trees... So you need slightly different kind of randomness distribution (like gauss). See the legendary:

on how to get a different distribution from uniform one...

Así que lo que debe hacer es conseguir algunos lugares al azar que estar cubriendo su forma uniforme región. Y luego generar árboles con densidad depende de la distancia mínima a estos puntos. La distancia más pequeña es la colocación de árboles densos.

placemet

Supongo que te gusta

Origin http://43.154.161.224:23101/article/api/json?id=181038&siteId=1
Recomendado
Clasificación