I’m drawing a curveVertex shape by adding a point(x,y) at different intervals of time, this points are stored in an array, the array is use to draw the curve.
When my object goes to the edge of the screen, I render It at the opposite side of the screen. This cause the curveVertex to draw a straight line from one side of the screen to the other.
So I wander if it is possible to trim/cut the curveVertex to avoid the line that goes across the screen? Hope that makes sense.
Thank you for your time, but you didn’t understood my problem. The issue is not moving the object it self, the problem is that the curveVertex draws a line across the screen the the object travels to the opposite side, hope that makes sense.
Are you trying to create a wrap-around object behavior, like Pac Man?
If so, @hamoid has put you on a correct path to a solution. You can define a PShape, detect if your object is overlapping a border, then draw it in two places if that is so.