We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4868280 commit 94b5cfcCopy full SHA for 94b5cfc
exercises/materials/perlin-noise/demo2.py
@@ -0,0 +1,15 @@
1
+from opensimplex import OpenSimplex
2
+import matplotlib.pyplot as plt
3
+
4
+def heightmap(n):
5
+ noise = OpenSimplex()
6
+ z = [[0 for x in range(n)] for y in range(n)]
7
+ for i in range(n):
8
+ for j in range(n):
9
+ z[i][j] = (noise.noise2d(((i + 1) / 10), ((j + 1) / 10)) + 1) * 10
10
+ return z
11
12
+z = heightmap(100)
13
14
+map = plt.imshow(z, cmap='terrain')
15
+plt.show()
0 commit comments