Skip to content

[p5.js 2.0 Bug Report]: noise broken #8026

@inaridarkfox4231

Description

@inaridarkfox4231

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.4

Web browser and version

Chrome

Operating system

Windows

Steps to reproduce this

Steps:

  1. use noise().
  2. p5.Editor case: An odd TypeError occurs
  3. OpenProcessing case: An odd FriendlyError occurs

Snippet:

function setup() {
  createCanvas(400, 400);

  console.log(noise(3));
  console.log(noise(3,4));
  console.log(noise(3,4,5));
}

version 2.0.3

p5.Editor

Image

OpenProcessing

Image

version 2.0.4

p5.Editor

Image

OpenProcessing

Image

broken code with p5.js 2.0.4

function setup() {
  createCanvas(600, 600);
  pixelDensity(1);
}

function draw() {
  background(0);
  translate(300, 300);
  let r=4000;
  noStroke();
  fill(255);
  const t = millis()/1000;
  while(r--){
    const x = (t*120 + fract(noise(r)*2)*500)%500;
    translate(x,0);
    rect(-1,-1,2,2);
    translate(-x,0);
    rotate(TAU/4000);
  }
}
Image

The noise function is dead.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions