We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, i know that this could be a newbie question but i did not figure it out how to solve it.
Even if i create a simple sketch where there is a line that start from 100,100 and goes to mouseX mouseY... i always get a line from the origin to the first point.
How can i avoid the initial line?
void setup(){
size(800,600);
}
void draw(){
line(100,100,mouseX,mouseY);
}
Answers
Not the most elegant way.
You see the initial line because the mouse variables start off at (0, 0). If you don't want this, you can set the variables to (100, 100) manually:
Now, if you want to get rid of the initial dot, as well, you can perform a simple check (which shouldn't effect the sketch's output):
Ok! great!. But now moving to something more complicated.. how can i avoid this with a two dimensional array of points? i'm using the mesh library
import megamu.mesh.*;
and instead of list all the points, the sketch add the point when some criteria are met. But seems that at the origin even before starting to run the draw, it adds the first point at the origin.Could you post the code? Maybe you can alter the criteria so that it doesn't draw the first point?