this is a code about dragging nodes where you should be able first to decide the lenght of the line and the numbers of nodes and then to makethe nodes draggable using mouse actions. The sliders work perfectly but the drag and drop function to move the nodes independently doesn't work. Do you have any ideashow to solve it??
guys, i m trying to create a controller to drag points in processing, the issue is that i m trying to connect the width of an edge to a slider to give a parameter to the main rectangle, but the nodes doesn t update with the rectangle. Any ideas to solve it ?????
Thanks, here you have the code
int posx1=90;
int posy1=90;
int posx2=530;
int posy2=530;
void setup() {
size(1200, 800);
smooth();
nodes1 = new ArrayList();
cp5 = new ControlP5(this);
// add a horizontal sliders, the value of this slider will be linked
// to variable 'sliderValue'
cp5.addSlider("w")
.setPosition(100,50)
.setRange(3,500)
;
line (x, y, x+w, y);
line (x+w, y, x+w, y+d);
line ( x+w, y+d, x, y+d);
line (x, y+d,x,y);
line (x+offset, y+offset, x+w-offset, y+offset);
line (x+w-offset, y+offset, x+w-offset, y+d-offset);
line (x+w-offset, y+d-offset, x+offset, y+d-offset);
line (x+offset, y+d-offset,x+offset,y+offset);