Dragging 3d model with mouse

Whats the best way of apply the mouses 2d position to a 3d object?

This is for dragging a model in a level editor.


That not what I am looking for.

Right now I have to vars, mouseSpeedX, and mouseSpeedY. These tell me how far the mouse has moved on its X and Y over the past frame.

How do I move the 3d object based on these speeds?

An example would be dragging a 3d model around the screen in Blender.

Have you tried this:

if base.mouseWatcherNode.hasMouse():
  self.mpos = base.mouseWatcherNode.getMouse()

where you can change the self.n value and put some factors to make it accurate

That wont work, because my camera is not just using a front view; its movable.

Is there some way to move the model relative to the cameras rotation?