How to get x,y,z coordinates of surface in the scene during mouse motion?

Hi there~
I have a shape rendered on the screen and I would like to find the x, y and z coordinates of the shape that is directly under the mouse coordinate. Example - if im running the mouse over a sine wave in 3D- When i do this currently I get the x and y coordinates of the viewport and not the surface.

Does anyone have any advice on how to do this?

Any comments will be much appreciated.

THank you

I hard about openGL picking mechanism but I guess it’s not accelerated. Anyway, it does not return xyz coords to you.

Maybe, you should do the transform yourself for the object which is under the mouse.
This requires to mess up with matrices and vertices. No problem, it’s easy, just take a look at some vertex programs out of there and you’ll get the idea.