How to send (ALL) rectangle coordinates to srial port.
in
Programming Questions
•
4 months ago
Hello. I am a newbie at processing and i need your help. Is there possible way to send some geometrical figures coordinates to serial port ? I am using "Continues lines example" to send coordinates of line, here is the segment of my script. And it works very good, but only because i can determine mouseX to cX variable, and mousY to cY. So i can easily draw in processing window, and send correct coordinates of a line. Is there possible way to draw other figures, and determine coordinates to my variables (cX), and (cY). Because when i determine for example rect(10,10,20,10,); i Don't know how to determine all rectangle coordinates.
<...>
stroke(255);
if(mousePressed)
{
line(mouseX, mouseY, pmouseX, pmouseY );
cX = mouseX;
cY = mouseY;
}<...>
1