beginShape(POINTS) in PShape

Processing 2.2.1 I'm having trouble creating a PShape that just draws points. it doesn't seem to be drawing the points at all:

void setup()
{
  size(500, 500, P2D);
  PShape p;
  p = createShape();
  p.setStrokeWeight(50);
  p.beginShape(POINTS);
  p.vertex(250, 250);
  p.endShape();
  shape(p);
}

Answers

  • edited October 2014

    Maybe this is helpful: https://www.processing.org/reference/beginShape_.html

    Although I have not used createShape(), the examples there work without it:

    void setup() {
      size(500, 500);
      strokeWeight(50);
      beginShape(POINTS);
      vertex(250, 250);
      endShape();
    }
    
  • It works when you don't use a PShape, but I would much prefer being able to use PShapes for what I'm doing. createShape is meant to work well with PShapes.

  • Seems like this is a bug in Processing. When you change to the P3D renderer, which uses different PShape creation methods (including 3D ones), the point does show up, so for now that could be a workaround. I suggest posting an issue about this here (with the code example and mentioning that P3D does work): https://github.com/processing/processing/issues

Sign In or Register to comment.