Projecting Vector using dot product help

To clarify, here is what I am trying to do.

I want to shoot rays from cam and it should go into the direction until its perfectly orthogonal between the red vector and not past that.

image

like so. However may rays seem to be too short. I notice that the rays I fire are orthogonal to the target however what I want to ensure is that the rays going from p to fired ray and ray to cam are orthogonal, not the fired ray to the point p

currently, I get these results: