I have a delta in screen coordinates that I want to transform to a 3d delta in world space.
The delta is in this case a movement across the (x,y) coordinates in screen space on the near projection plane for a known z in the 3d space. The goal is to move an object in 3d space horizontally and vertically.
How would I do this?
I guess it has something to do with getting rid of the translation component in the world-view-projection matrix, as the delta is only influenced by the scaling and rotation part of the matrices.
I tried the naive approach by setting the translation component in the world-view-projection matrix to 0, but that did not work.
The only working solution i found so far is to unproject the (0,0,z) coordinate of the object to world space and then unproject the delta (x,y,z) to world space. The result of these 2 un-projections is then substracted to get the delta in world space.
deltayou mean some form of difference (vector? distance?). Basically a screen coordinate translate into a line in 3D space, in some cases it makes sense to do a line pick along that line to find what item the player sees at that point, but otherwise there is no inherent way of transforming screen coordinates to world coordinates. – eBusiness Dec 27 '12 at 15:15