>>7
it is projecting points on a plane onto a different plane. You do it by scaling the vector. If you know the depth from the camera for every single pixel in the sprite, then:
make a rectangular mesh, one vertex for every pixel.
park dat rectangular mesh next to da cam. Lets have it so like the z coordinate is the depth. Lets park the rectangular mesh so that it's coordinates look like (x,y,1).
Suppose ya know what the z coordinate of a point on the model should be for a pixel. Suppose it is c.
Then take that vector (x,y,1) and scale it by c to get (cx,cy,c). There ya go!
No supposen you don't know what this c is. Like you don't know what the z coordinate of the point on the model is, but you know how far away that point is from the camera.
Then pythag that shit bro: you know d and d = \sqrt((cx)^2 + (cy)^2 + c^2). Now solve for the c in terms of d x and y bra.