Lines
in
Programming Questions
•
1 year ago
Im new ion the processing im doing basic stuff well im doing a vector in 3D that moves in x,y,z position but whe i wanna erase the line so u can only see one line it keeps repeting itself so what can i do to erase it and only see one line or vector thx in advanse here is the code, it might be simple but im new at this.
float rmax, angle, x1, x2, y1, y2,anX,anY;
void setup()
{
size (700,500, P3D);
background(128);
smooth();
}
void draw()
{
angle = ((2*PI/width)*(mouseX-width/2));
smooth();
//Ejes Coordenados
stroke(255);
line(300,300,0,350,300,200);//x
line(300,300,0,300,350,200);//y
line(300,300,0,300,300,450);//z
anX=map(mouseX, 0, width, -PI, PI);
anY=map(mouseY, 0, height, -PI, PI);
//Borrar datos antiguos
pushMatrix();
translate(300,300,50);
rotateY(anX);
rotateZ(anY);
stroke(128);
line (0,0,0,50,0,0);
popMatrix();
pushMatrix();
translate(300,300,50);
stroke(245,17,17);
rotateY(anX);
rotateZ(anY);
strokeWeight(3);
strokeCap(ROUND);
line (0,0,0,50,0,0);
popMatrix();
}
1