Skip to content

Instantly share code, notes, and snippets.

@merttoka
Last active August 10, 2021 20:38
Show Gist options
  • Save merttoka/84cc0c591f029d6f5abc1ce46952a05a to your computer and use it in GitHub Desktop.
Save merttoka/84cc0c591f029d6f5abc1ce46952a05a to your computer and use it in GitHub Desktop.
Processing second sketch vertex error
SecondSketch second;
void setup() {
size(800, 800, P3D);
colorMode(HSB, 360, 100, 100);
frameRate(60);
}
void draw() {
background(0);
PShape p = createShape();
p.beginShape();
p.noFill();
p.strokeWeight(5);
p.stroke(255, 150);
for(int i=0; i< 1000; i++) {
p.vertex(width/2, mouseY+i*20, height/2);
}
p.endShape();
shape(p);
}
void keyPressed() {
if(key == 's') {
second = new SecondSketch();
second.run(100, 100);
}
}
class SecondSketch extends PApplet {
// APPLET --------------------------------
SecondSketch() {
super();
}
public void run(int x, int y) {
String[] processingArgs = { "--location=" + x + "," + y, "Second Sketch" };
PApplet.runSketch(processingArgs, this);
}
void settings() {
size(500, 200, P3D);
}
void setup() {
colorMode(HSB, 360, 100, 100);
frameRate(60);
}
void draw() {
background(0);
PShape p = createShape();
p.beginShape();
p.noFill();
p.strokeWeight(5);
p.stroke(255, 150);
for(int i=0; i< 1000; i++) {
p.vertex(width/2, mouseY+i*20, height/2);
}
p.endShape();
shape(p);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment