Last active
August 10, 2021 20:38
-
-
Save merttoka/84cc0c591f029d6f5abc1ce46952a05a to your computer and use it in GitHub Desktop.
Processing second sketch vertex error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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