Skip to content

Commit

Permalink
Merge pull request #7330 from RandomGamingDev/noise-docs-dim-consistency
Browse files Browse the repository at this point in the history
Uses canvas dimensions instead of arbitrary constants for `noise()` and `noiseDetail()`
  • Loading branch information
davepagurek authored Oct 22, 2024
2 parents 983276d + 01d63b0 commit 03b9517
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/math/noise.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ let perlin; // will be initialized lazily by noise() or noiseSeed()
* let noiseScale = 0.002;
*
* // Iterate from left to right.
* for (let x = 0; x < 100; x += 1) {
* for (let x = 0; x < width; x += 1) {
* // Scale the input coordinates.
* let nx = noiseScale * x;
* let nt = noiseScale * frameCount;
Expand All @@ -195,9 +195,9 @@ let perlin; // will be initialized lazily by noise() or noiseSeed()
* let noiseScale = 0.01;
*
* // Iterate from top to bottom.
* for (let y = 0; y < 100; y += 1) {
* for (let y = 0; y < height; y += 1) {
* // Iterate from left to right.
* for (let x = 0; x < 100; x += 1) {
* for (let x = 0; x < width; x += 1) {
* // Scale the input coordinates.
* let nx = noiseScale * x;
* let ny = noiseScale * y;
Expand Down Expand Up @@ -230,7 +230,7 @@ let perlin; // will be initialized lazily by noise() or noiseSeed()
* let noiseScale = 0.009;
*
* // Iterate from top to bottom.
* for (let y = 0; y < 100; y += 1) {
* for (let y = 0; y < height; y += 1) {
* // Iterate from left to right.
* for (let x = 0; x < width; x += 1) {
* // Scale the input coordinates.
Expand Down Expand Up @@ -361,9 +361,9 @@ p5.prototype.noise = function(x, y = 0, z = 0) {
* let noiseScale = 0.02;
*
* // Iterate from top to bottom.
* for (let y = 0; y < 100; y += 1) {
* for (let y = 0; y < height; y += 1) {
* // Iterate from left to right.
* for (let x = 0; x < 50; x += 1) {
* for (let x = 0; x < width / 2; x += 1) {
* // Scale the input coordinates.
* let nx = noiseScale * x;
* let ny = noiseScale * y;
Expand Down

0 comments on commit 03b9517

Please sign in to comment.