Well here's the code I'm using for 3D Mouse Coordinates for my game:
dbPickScreen ( dbMouseX ( ), dbMouseY ( ), dbCameraPositionY ( ) );
float mult = dbABS ( dbCameraPositionY ( ) / dbGetPickVectorY ( ) );
float xv = dbGetPickVectorX ( ) * mult + dbCameraPositionX ( );
float yv = dbGetPickVectorY ( ) * mult + dbCameraPositionY ( );
float zv = dbGetPickVectorZ ( ) * mult + dbCameraPositionZ ( );
dbPositionObject ( Player.MovementVector, xv, yv, zv );
Player.MovementVector is just an object I use so the player can point to it and move to it. But you can accomplish the same thing with a struct.
If you wish to do it with a struct put this in your variable declaration area:
typedef struct _MovementVector
{
float x;
float y;
float z;
};
_MovementVector MovementVector;
Then instead of using:
dbPositionObject ( Player.MovementVector, xv, yv, zv );
use:
MovementVector.x = xv;
MovementVector.y = yv;
MovementVector.z = zv;
Now you have a virtual object without needing to make a box and such.
Use Google first... it's not rocket surgery!