In an attempt to convert screen space coordinates into world space coordinates, I\'ve been doing the following calculation:
WorldSpace Vector = inverse(Projection M
In this last stage of my ray picking problem, I was informed that I was doing several things wrong:
glm::vec4 wSC = (mat) * glm::vec4(winX,winY,0,0);
line.winX = ((float)x/viewport[2]*2)-1;
winY = ((float)(viewport[3]-y)/viewport[3]*2)-1;
Since my problem extended over quite a great length of time, and took up several questions, I owe credit to a few individuals who helped me along the way: