To generate terrain using perlin noise, you can create a Terrain
entity with the heightmap with your perlin noise image :
from ursina import *
app = Ursina()
noise = 'perlin_noise_file' # file
t = Terrain(noise) # noise must be a file
app.run()
To make a perlin noise, you can use the perlin_noise library. Here is an example from the docs :
import matplotlib.pyplot as plt
from perlin_noise import PerlinNoise
noise = PerlinNoise(octaves=10, seed=1)
xpix, ypix = 100, 100
pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)]
plt.imshow(pic, cmap='gray')
plt.show()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…