I'm currently using processing to create a visual interface for a project using the reacTIVision framework, which uses a camera to detect markers.
Above is a demo of what I've got so far. The black circle is static, whereas the squares are dynamic and change their location and rotation based on the parameters of the markers picked up by the camera. The white shape connects the black circle with the red square and moves as the square is moved.
However I now want to set it so that the program detects when the centre of the blue square is moved into the bounds of the white shape (which is a quad()), and for instance change the squares colour. Can anyone give me a starting point to how I can accomplish this? Would this kind of thing still be possible if the quad() was substituted for a line() shape, so that the program would detect when the blue square is resting on any point of the line?