Character in 3D space following mouseX

Hey All,

I’m a non-3D guy with a 3D problem to solve.

I have a character moving around in 3D space (his Z value is fixed, like a 2D side-scroller with 3D graphics). He’s supposed to follow the mouse. But because the mouse’s Z is not the same as the character’s, I obviously can’t just set his Z to that of the mouse.

I’m pretty sure I need to use the distance between the character and the camera when calculating the character’s new X position. But I’m not the mathiest person around, and the wiki article on 3D projection (http://en.wikipedia.org/wiki/3D_projection) made me a little dizzy. All I know is I need to do the inverse of what that article describes.

I’m not using any 3D engines. I’ve found posts about certain versions of PaperVision that actually have a method built into the Camera class to do exactly this (Camera.unproject()). I’m going to attempt to dig into that to see if I can pull out the formula that I need. But in the meantime I thought I would pick the brains of you brilliant Kirupians.

Thanks!
K