terrain-map
ARCHIVED - repo for blog post http://www.vogt.world/writing/procedural-terrain-generation/
git clone https://git.vogt.world/terrain-map.git
Log | Files | README.md
← Commit log
commit
message
check-in, getting close
author
Ben Vogt <[email protected]>
date
2016-05-14 04:57:55
stats
4 file(s) changed, 98 insertions(+), 66 deletions(-)
files
erosion.js
landmap.js
main.js
worker.js
  1diff --git a/erosion.js b/erosion.js
  2deleted file mode 100644
  3index e399ab4..0000000
  4--- a/erosion.js
  5+++ /dev/null
  6@@ -1,16 +0,0 @@
  7-self.importScripts('landmap.js');
  8-self.addEventListener('message', function(e) {
  9-  var terrain = new LandMap({
 10-    containerId: "container-5"
 11-  });
 12-  terrain.generate(0.75, "standard");
 13-  terrain.complexErosion({
 14-    carryingCapacity: 1.0,
 15-    depositionSpeed: 0.1,
 16-    iterations: 3,
 17-    drops: 2000000,
 18-    one: "standard",
 19-    two: "complexErosion-8000000-3ipd"
 20-  });
 21-  self.postMessage(terrain);
 22-}, false);
 23diff --git a/landmap.js b/landmap.js
 24index 34f9375..cd628d6 100644
 25--- a/landmap.js
 26+++ b/landmap.js
 27@@ -474,11 +474,6 @@ LandMap.prototype.complexErosion = function(options) {
 28   }
 29 };
 30 
 31-LandMap.prototype.spinner = function() {
 32-  var spinner = '<img class="spinner" width="24" height="24" src="data:image/gif;base64,R0lGODlhGAAYAKUAAAwODJSSlMzKzExOTKyurOTm5GxubCwuLLy+vKSipNza3GRmZPT29Dw+PFRWVLS2tHx+fDQ2NCQmJJyanNTW1Ozu7MTGxKyqrOTi5Pz+/BwaHMzOzFRSVLSytHx6fDQyNMTCxKSmpNze3GxqbPz6/ExKTFxaXLy6vISGhDw6PJyenPTy9P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBQAsACwAAAAAGAAYAAAG/kCWcEjMeCDEpJK1Oq2EDIeDJKwknkshYjERkjhToed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MoDBQc50yQAGYnImcSdl0TwqHTnCAAOw==" />';
 33-  document.getElementById(this.containerId).innerHTML = spinner;
 34-}
 35-
 36 LandMap.prototype.draw = function() {
 37   var html = '<div class="row">';
 38   var featureCount = 0;
 39diff --git a/main.js b/main.js
 40index 63772b2..7397451 100644
 41--- a/main.js
 42+++ b/main.js
 43@@ -1,65 +1,52 @@
 44 var worker;
 45 $(document).ready(function() {
 46 
 47+  function spinner(id) {
 48+    
 49+  }
 50+
 51   $("#standard").click(function() {
 52-    var standardMap = new LandMap({
 53-      containerId: "container-1"
 54-    });
 55-    standardMap.generate(0.75, "standard");
 56-    standardMap.smooth(10, "standard", "smoothed-10");
 57-    standardMap.smooth(20, "standard", "smoothed-20");
 58-    standardMap.draw();
 59+    var worker = new Worker('worker.js');
 60+    worker.postMessage("standard");
 61+    worker.addEventListener('message', function(e) {
 62+      var terrain = new LandMap(e.data);
 63+      terrain.draw();
 64+    }, false);
 65   });
 66 
 67   $("#combined").click(function() {
 68-    var terrain = new LandMap({
 69-      containerId: "container-2"
 70-    });
 71-    terrain.generate(0.75, "standard");
 72-    terrain.generate(0.75, "standard-two", "DS with 0.75");
 73-    terrain.smooth(10, "standard", "standard-10");
 74-    terrain.smooth(20, "standard-two", "standard-two-20");
 75-    terrain.combine("standard", "standard-10", "standard-two-20", "combined");
 76-    terrain.combine("standard-10", "standard", "standard-two-20", "reversed");
 77-    terrain.draw();
 78+    var worker = new Worker('worker.js');
 79+    worker.postMessage("combined");
 80+    worker.addEventListener('message', function(e) {
 81+      var terrain = new LandMap(e.data);
 82+      terrain.draw();
 83+    }, false);
 84   });
 85 
 86   $("#grd").click(function() {
 87-    var terrain = new LandMap({
 88-      containerId: "container-3"
 89-    });
 90-    terrain.generate(0.75, "standard");
 91-    terrain.grd(22, 0.01, "standard", "grd-22-0.01");
 92-    terrain.grd(20, 0.03, "standard", "grd-20-0.03");
 93-    terrain.grd(40, 0.01, "standard", "grd-40-0.01");
 94-    terrain.draw();
 95+    var worker = new Worker('worker.js');
 96+    worker.postMessage("grd");
 97+    worker.addEventListener('message', function(e) {
 98+      var terrain = new LandMap(e.data);
 99+      terrain.draw();
100+    }, false);
101   });
102 
103 
104   $("#simpleErosion").click(function() {
105-    var terrain = new LandMap({
106-      containerId: "container-4"
107-    });
108-    terrain.generate(0.75, "standard");
109-    terrain.simpleErosion({
110-      carryingCapacity: 1.5,
111-      depositionSpeed: 0.03,
112-      iterations: 10,
113-      drops: 1000000,
114-      one: "standard",
115-      two: "simpleErosion"
116-    });
117-    terrain.draw();
118+    var worker = new Worker('worker.js');
119+    worker.postMessage("simpleErosion");
120+    worker.addEventListener('message', function(e) {
121+      var terrain = new LandMap(e.data);
122+      terrain.draw();
123+    }, false);
124   });
125 
126   $("#complexErosion").click(function() {
127-    var terrain;
128-    worker = new Worker('erosion.js');
129-    worker.postMessage(0);
130+    var worker = new Worker('worker.js');
131+    worker.postMessage("complexErosion");
132     worker.addEventListener('message', function(e) {
133-      console.log(e.data.maps)
134-      terrain = new LandMap(e.data);
135-      console.log(terrain.maps)
136+      var terrain = new LandMap(e.data);
137       terrain.draw();
138     }, false);
139   });
140diff --git a/worker.js b/worker.js
141new file mode 100644
142index 0000000..03a6a1b
143--- /dev/null
144+++ b/worker.js
145@@ -0,0 +1,65 @@
146+self.importScripts('landmap.js');
147+self.addEventListener('message', function(e) {
148+  var data = e.data;
149+  var terrain;
150+  switch (data) {
151+    case 'complexErosion':
152+      terrain = new LandMap({
153+        containerId: "container-5"
154+      });
155+      terrain.generate(0.75, "standard");
156+      terrain.complexErosion({
157+        carryingCapacity: 1.0,
158+        depositionSpeed: 0.1,
159+        iterations: 3,
160+        drops: 2000000,
161+        one: "standard",
162+        two: "complexErosion-8000000-3ipd"
163+      });
164+      break;
165+    case 'simpleErosion':
166+      terrain = new LandMap({
167+        containerId: "container-4"
168+      });
169+      terrain.generate(0.75, "standard");
170+      terrain.simpleErosion({
171+        carryingCapacity: 1.5,
172+        depositionSpeed: 0.03,
173+        iterations: 10,
174+        drops: 1000000,
175+        one: "standard",
176+        two: "simpleErosion"
177+      });
178+      break;
179+    case 'grd':
180+      terrain = new LandMap({
181+        containerId: "container-3"
182+      });
183+      terrain.generate(0.75, "standard");
184+      terrain.grd(22, 0.01, "standard", "grd-22-0.01");
185+      terrain.grd(20, 0.03, "standard", "grd-20-0.03");
186+      terrain.grd(40, 0.01, "standard", "grd-40-0.01");
187+      break;
188+    case 'combined':
189+      terrain = new LandMap({
190+        containerId: "container-2"
191+      });
192+      terrain.generate(0.75, "standard");
193+      terrain.generate(0.75, "standard-two", "DS with 0.75");
194+      terrain.smooth(10, "standard", "standard-10");
195+      terrain.smooth(20, "standard-two", "standard-two-20");
196+      terrain.combine("standard", "standard-10", "standard-two-20", "combined");
197+      terrain.combine("standard-10", "standard", "standard-two-20", "reversed");
198+      break;
199+    case 'standard':
200+      terrain = new LandMap({
201+        containerId: "container-1"
202+      });
203+      terrain.generate(0.75, "standard");
204+      terrain.smooth(10, "standard", "smoothed-10");
205+      terrain.smooth(20, "standard", "smoothed-20");
206+      break;
207+  };
208+  console.log(terrain)
209+  self.postMessage(terrain);
210+}, false);