Find point of Ray using origin and direction

You don’t need a library for this.

By varying scale factor “m” you get all points on the ray with the help of the following three equations, with point “p”, origin “o” and direction “d”:

1. p.x = o.x + m * d.x
2. p.y = o.y + m * d.y
3. p.z = o.z + m * d.z

Since you know the target z-coordinate of the point and also the z-components or origin and direction (3rd equation), that gives you the value of “m”.

Then plug that “m” into equations 1 and 2 to get the x, y components of your target point.