processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.65k stars 3.32k forks source link

Vertex is now seemingly totally broken #3473

Closed Trimad closed 5 years ago

Trimad commented 5 years ago

Nature of issue?

Most appropriate sub-area of p5.js?

Which platform were you using when you encountered this?

Details about the bug:

function setup() {
  createCanvas(800, 800, WEBGL);
}

function draw() {
  background(51);
  beginShape(LINES);
  vertex(30, 20, 0);
  vertex(85, 20, 0);
  vertex(85, 75, 0);
  vertex(30, 75, 0);
  endShape();
}

When I run this snippet of code in the p5.js web editor, it works as intended. When I run it locally in Chrome or in Firefox, my console is flooded with errors. In fact I can't get vertex to work at all in either Chrome or Firefox now. See screenshots.

Firefox vertex-firefox p5.js web editor vertex-editor Google Chrome vertex-chrome

Trimad commented 5 years ago

Another development:

So I've discovered that if I texture my shape with an image, the program works as intended. Problem is, I don't want to texture my shape. Working code:

var img;

function preload() {
  img = loadImage('water.jpg');
}

function setup() {
  createCanvas(1024, 1024, WEBGL);
}

function draw() {
  rotateX(frameCount*0.01);
  rotateY(frameCount*0.01);
  background(51);
  texture(img);
  textureMode(IMAGE);
  beginShape(LINES);
  vertex(0, 512, 0, 0, 512);
  vertex(512, 512, 0, 512, 512);
  vertex(512, 0, 0, 512, 0);
  vertex(0, 0, 0, 0, 0);
  endShape();
}

textured

sanketsingh24 commented 5 years ago

I cannot replicate the error in my system:

EDIT: only the first one

limzykenneth commented 5 years ago

@Trimad Have you tried the sketches outside of the Processing p5.js mode? The mode is not maintained officially and will likely be out of date. If you wish to run you code locally you will need to follow steps lay out here

lmccart commented 5 years ago

If you want to report issues with processing p5.js mode, you can do that here: https://github.com/fathominfo/processing-p5js-mode