rendering problems using vertex and PGraphics
in
Programming Questions
•
2 years ago
Hey, anyone knows why the lines (vertex) dont connect (seems so), when i use PGraphics?
please look at the code, guess this makes it clear what i mean...
thanks!
please look at the code, guess this makes it clear what i mean...
- PGraphics m1 = createGraphics(40,40,P2D);
- PGraphics m2 = createGraphics(40,40,P2D);
- background(255);
- smooth();
- m1.beginDraw();
- m1.noStroke();
- m1.fill(0,255,255);
- m1.rect(0,0,40,40);
- m1.endDraw();
- m2.beginDraw();
- m2.stroke(255,0,255);
- m2.strokeWeight(6);
- m2.strokeCap(ROUND);
- m2.beginShape();
- m2.vertex(5,15);
- m2.vertex(15,5);
- m2.vertex(25,15);
- m2.vertex(35,5);
- m2.endShape();
- m2.endDraw();
- image(m1,10,10);
- for(int i = 0; i < 40; i+=15)
- blend(m2, 0,0,40,40, 20,10+i, 40,40, MULTIPLY);
- noFill();
- strokeWeight(6);
- strokeCap(CORNER);
- translate(20,60);
- beginShape();
- vertex(5,15);
- vertex(15,5);
- vertex(25,15);
- vertex(35,5);
- endShape();
thanks!
1