Sorry for the confusion. Your math is correct. You were using gluUnproject, so I thought my response was in context. You use (winx, winy, .3) and (winx, winy, .6) with gluUnproject to get the two points in 3D space as I said. You construct a vector from those two points. Not the two window coordinates as that would indeed always be (0,0,.3).

(winx, winy, .3) --> (worldX1, worldY1, worldZ1)

(winy, winy, .6) --> (worldX2, worldY2, worldZ2)

vec = normalize((worldX2, worldY2, worldZ2) - (worldX1, worldY1, worldZ1))

and that’s your vector in world space (assuming you give gluUnproject the basic modelview matrix).