Skip to content

Commit d039e38

Browse files
committed
Finalised tweaks for Noise lab
1 parent 0a4d6d7 commit d039e38

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

Diff for: Noise.html

+6-18
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242

4343
<!-- Page content -->
4444
<div class="section">
45-
<p> This is the noise page </p>
46-
4745
<h2> What you'll create </h2>
4846

4947
<p> The aim of this workshop is understand some applications of Perlin Noise, and use it to create some colourful terrain!
@@ -70,13 +68,11 @@ <h3> What is a sketch? </h3>
7068
Just like a game, your simulation will have frames (an image of your simulation) and p5.js will aim to show 60 frames a second.
7169
You'll be able to code what happens on certain events e.g. just before a frame is shown, just before the simulation starts, when the mouse is clicked.
7270

73-
<br>
71+
<br><br>
7472

7573
In this lab, since we're just drawing an image, we'll only concern ourselves with drawing before the simulation starts and when the mouse is clicked.
7674
</p>
7775

78-
<br>
79-
8076
<p> Your new sketch should have 2 functions: </p>
8177

8278
<ul>
@@ -100,13 +96,17 @@ <h3> What is a sketch? </h3>
10096
</pre>
10197
<em> RGB values have R,G,B values ranging from 0-255 </em>
10298

99+
<br>
100+
103101
<p><strong>Mini-Task:</strong> Try running the above simulation! Maybe change the variables to display your own favourite colour. </p>
104102

105103
<h2> Creating Random Noise </h2>
106104

107105
<div id="RandomHeightMap"></div>
108106
<em>Click to generate new random noise</em>
109107

108+
<br>
109+
110110
<p>Let's dive straight into generating random noise! We'll need to know a couple things: </p>
111111

112112
<ol>
@@ -169,8 +169,6 @@ <h3>Pixels</h3>
169169
If we're only using grayscale colours, then we can provide just a single value (to represent the brightness or "value" of the colour) e.g. 255 for pure white, 0 for pure black.
170170
</p>
171171

172-
<br>
173-
174172
<p>Using this knowledge, can you guess what the following code does?</p>
175173

176174
<pre>
@@ -193,7 +191,7 @@ <h3>Pixels</h3>
193191
<h3>Random Values</h3>
194192

195193
<p>A key thing to remember about p5.js is that ultimately, it is still JavaScript. Therefore, we can use JavaScript functions and libraries with p5.js. </p>
196-
<br>
194+
197195
<p>To handle randomness, we'll use js' Math library; in particular, the function <strong>Math.random()</strong>! Let's use the JavaScript console to test it out. </p>
198196

199197
<pre>
@@ -311,21 +309,17 @@ <h3>More Detailed Islands </h3>
311309
After all, terrain isn't perfectly smooth in nature!
312310
</p>
313311

314-
<br>
315312

316313
<p>You can add this granular detail by adding layers of perlin noise together; each of these layers being called "octaves".
317314
Typically, you'll have a large amplitude perlin noise wave which describes the general overall shape,
318315
and then you'll have a smaller amplitude perlin noise waves to describe the finer details.
319316
These smaller waves usually have higher frequency, which will give the islands a distinct roughness.
320317
</p>
321318

322-
<br>
323319

324320
<p> You can increase the number of octaves and how much the smaller waves contribute to the noise by using p5's <strong>noiseDetail()</strong> function.
325321
Read up on the details <a href="https://p5js.org/reference/p5/noiseDetail/">here</a>.</p>
326322

327-
<br>
328-
329323
<p>You can also add more "detail" to the islands by creating multiple threshold levels, like in the example at the top of this webpage! An example of a more complicated threshold colour function: </p>
330324

331325
<pre>
@@ -357,7 +351,6 @@ <h2> Final Task: Create your own islands! </h2>
357351
You can take my generator(s) (displayed at the top of the page) as inspiration, but I'm sure you'll be able to create a better looking generator than mine.
358352
</p>
359353

360-
<br>
361354

362355
<p>You can view the code for my two generators here:</p>
363356
<ul>
@@ -376,11 +369,6 @@ <h2> Going Further </h2>
376369
<li>Adding trees e.g. with poisson-disc sampling </li>
377370
<li>Structure generation</li>
378371
</ul>
379-
380-
<ol>
381-
<li>Add fragments/headers </li>
382-
<li></li>
383-
</ol>
384372
</section>
385373
</body>
386374
</html>

Diff for: Stylesheets/Default.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.section {
2+
padding-left: 20px;
3+
}

0 commit comments

Comments
 (0)