Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses canvas dimensions instead of arbitrary constants for noise() and noiseDetail() #7330

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading