--- a/content/blog/2016/02/midpoint-displacement.html Tue Jun 28 23:39:20 2016 +0000
+++ b/content/blog/2016/02/midpoint-displacement.html Wed Jun 29 13:22:45 2016 +0000
@@ -25,6 +25,12 @@
In this post we'll be looking at Midpoint Displacement.
+The full series of posts so far:
+
+* [Midpoint Displacement](/blog/2016/02/midpoint-displacement/)
+* [Recursive Midpoint Displacement](/blog/2016/03/recursive-midpoint-displacement/)
+* [Diamond Square](/blog/2016/03/diamond-square/)
+
[project]: https://www.youtube.com/watch?v=G5u79w4qiAA
[Unity]: http://unity3d.com/
--- a/content/blog/2016/03/recursive-midpoint-displacement.html Tue Jun 28 23:39:20 2016 +0000
+++ b/content/blog/2016/03/recursive-midpoint-displacement.html Wed Jun 29 13:22:45 2016 +0000
@@ -22,6 +22,12 @@
the cleanest way to do it. Before moving on to other algorithms I wanted to
clean things up by using a handy library.
+The full series of posts so far:
+
+* [Midpoint Displacement](/blog/2016/02/midpoint-displacement/)
+* [Recursive Midpoint Displacement](/blog/2016/03/recursive-midpoint-displacement/)
+* [Diamond Square](/blog/2016/03/diamond-square/)
+
[mpd]: /blog/2016/02/midpoint-displacement/
[TOC]
--- a/content/blog/2016/06/diamond-square.html Tue Jun 28 23:39:20 2016 +0000
+++ b/content/blog/2016/06/diamond-square.html Wed Jun 29 13:22:45 2016 +0000
@@ -5,7 +5,7 @@
{% hyde
title: "Terrain Generation with Diamond Square"
snip: "Improving on Midpoint Displacement."
- created: 2016-06-27 13:45:00
+ created: 2016-06-27 13:35:00
%}
{% block extra_js %}
@@ -27,11 +27,11 @@
* [Recursive Midpoint Displacement](/blog/2016/03/recursive-midpoint-displacement/)
* [Diamond Square](/blog/2016/03/diamond-square/)
-Midpoint Displacement is fairly simple and pretty fast, but it suffers from some
-flaws. If you look at the end result you'll probably start to notice "seams" in
-the terrain that appear on perfectly square chunks. This happens because when
-you're calculating the midpoints of the edges of each square you're only
-averaging two sources.
+Midpoint Displacement is simple and fast, but it has some flaws. If you look at
+the end result you'll probably start to notice "seams" in the terrain that
+appear on perfectly square chunks. This happens because when you're calculating
+the midpoints of the edges of each square you're only averaging two sources of
+information.
[Diamond Square][] is an algorithm that works a lot like Midpoint Displacement,
but it adds an extra step to ensure that (almost) every point uses *four*
@@ -168,8 +168,8 @@
└─┴─┴─┴─┴─┴─┴─┴─┴─┘ └─┴─┴─┴─┴─┴─┴─┴─┴─┘
</pre>
-First we define how do do a single diamond-shaped region. Once again we'll use
-a center point and radius to specify the region inside the heightmap:
+Once again we'll use a center point and radius to specify the region inside the
+heightmap:
:::clojure
(defn ds-diamond [heightmap x y radius spread]
@@ -235,13 +235,12 @@
## Iteration
-Unfortunately we can't use recursion to iterate for diamond square like we did
-for midpoint displacement. We have to interleave the diamond and square steps,
+Unfortunately we can't use recursion to iterate for Diamond Square like we did
+for Midpoint Displacement. We have to interleave the diamond and square steps,
performing each round of squares on the *entire* map before moving on to a round
-of diamonds.
+of diamonds. If we don't, bad things will happen.
-If we don't, bad things will happen. Let's look at an example to see why.
-First we perform the initial square step:
+Let's look at an example to see why. First we perform the initial square step:
<pre class="lineart">
Column
@@ -460,7 +459,7 @@
<div id="demo-final" class="threejs"></div>
-It looks a lot like the result from midpoint displacement, but without the ugly
+It looks a lot like the result from Midpoint Displacement, but without the ugly
seams around the square chunks.
The code for these blog posts is a bit of a mess because I've been copy/pasting
--- a/layout/skeleton/_base.html Tue Jun 28 23:39:20 2016 +0000
+++ b/layout/skeleton/_base.html Wed Jun 29 13:22:45 2016 +0000
@@ -81,13 +81,11 @@
<footer>
<p>
- I'm also on
- <a href="https://bitbucket.org/sjl/">Bitbucket</a>,
- <a href="https://github.com/sjl/">GitHub</a>,
- <a href="https://twitter.com/stevelosh/">Twitter</a>,
- <a href="https://instagram.com/thirtytwobirds/">Instagram</a>,
- and
- <a href="http://500px.com/stevelosh/">500px</a>.
+ <a href="https://bitbucket.org/sjl/">Bitbucket</a> ・
+ <a href="https://github.com/sjl/">GitHub</a> ・
+ <a href="https://twitter.com/stevelosh/">Twitter</a> ・
+ <a href="https://instagram.com/thirtytwobirds/">Instagram</a> ・
+ <a href="https://bitbucket.org/sjl/.plan/#readme">.plan</a>
</p>
<a class="rochester-made" href="http://rochestermade.com" title="Rochester Made"><img src="http://rochestermade.com/media/images/rochester-made-dark-on-light.png" alt="Rochester Made" title="Rochester Made" /></a>