I hope this makes sense as it is alittle hard to explain this problem.
I’m not sure why this is happening but when I draw an object whose coordinates are both in front of the field of view and behind I get a strange effect where objects coordinates go crazy. This is using beginShape() and the vertex() function with endShape(CLOSE) to finish the shape.
For example in the sketch I draw a bunch of objects then -= there z value each frame to give the illusion of flying over the scene. But when an object is being drawn half in the field of view and half behind the field of view its coordinates go crazy. As you can see in the screenshot the red line that is going diagonally across the screen should be drawn entirely along the z plane like all the other red lines in the screen.
Anyone have any suggestions on how to fix or get around this problem.