Orthographic camera math problem

When the respective blue lines being projected meet the orange lines, the camera should stop following the target.
The scale of the image plane isn’t (1,1,1). Is this important to know?


If the image plane wasn’t rotated, it would be a matter of using the z coordinate, and I realize it still is, but that z coordinate must be multiplied by 1 because of some function. And in this case where the image plane is rotated, that 1 must be something different based on the rotation, but I just don’t know

maybe smt like this?


dir = -camera.getAxisVect([0,0,1])
#cast ray: rayCast(<i>objto</i>, <i>objfrom</i>, <i>dist</i>, <i>prop</i>, <i>face</i>, <i>xray</i>, <i>poly</i>, <i>mask</i>)
raylist = camera.rayCast(camera.position+dir,camera,9999,"ground",0,1) #need arguments till xray
pos = raylist[1]

if pos[0] &gt; somevalue or pos[1] &gt; somevalue2: #or something like that
    #stop moving

cast a ray to a plane on the ground and then stop the camera based on these coordinates, you could prob guess them

edit:
or just cast a ray on your terrain and based on that stop the camera