Add smooth terrain

This commit is contained in:
2024-06-16 20:08:24 +02:00
parent 7c59b04ec3
commit c1aa61ca95
22 changed files with 71 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
from world_maker.World import World
from PIL import Image
from world_maker.data_analysis import (get_data, filter_negative, rectangle_2D_to_3D, skeleton_mountain_map, highway_map, filter_sobel, skeleton_highway_map,
smooth_sobel_water, subtract_map, detect_mountain)
smooth_sobel_water, subtract_map, detect_mountain, filter_smooth)
from world_maker.City import City
from world_maker.Position import Position
from random import randint
@@ -11,8 +11,13 @@ from world_maker.pack_rectangle import generate_building
def world_maker():
world = World()
heightmap, watermap, treemap = get_data(world)
filter_smooth(
'./world_maker/data/heightmap.png', 4).save('./world_maker/data/heightmap_smooth.png')
filter_sobel(
"./world_maker/data/heightmap.png").save('./world_maker/data/sobelmap.png')
smooth_sobel_water_map = smooth_sobel_water()
skeleton_highway = skeleton_highway_map(highway_map())
city = City()