How can i connect points?
in
Programming Questions
•
1 years ago
Hey guys,
First Iam a very beginner on processing and I realy need your help.
Questions:
1)In the case below, how can I connect 1 poin t( when a line end and the other begin) to the four last one?
2)
I would like to draw in 3D not only 2D.
THANK YOU IN ADVANCE
import peasy.*;
import processing.opengl.*;
float ax,ay;
int distance = 40;
void setup() {
size(500,500);
smooth();
background(255);
ax = 500/2;
ay = 500/2;
}
void draw() {
float x = ax + random(-distance,distance);
float y = ay + random(-distance,distance);
line(ax,ay,x,y);
line(ax,ay,x,y);
ax = x;
ay = y;
}
void keyPressed() {
if (key == ' ') {
background(255);
ax = width/2;
ay = height/2;
}
}
1