The last time I wanted to go from window coordinates (pixels) to eye coordinates, I followed the steps outlined here in the OpenGL wiki. Once you have the eye coordinates, you can just normalize the vector to obtain $r_{ij}$.
bernie
- 830
- 5
- 10