Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualslicer4ever

Posted 04 April 2013 - 01:41 AM

I'm in the process of making a 2d game, and have made a transition from using d3d's 2D scene to just using 3d quads, however this is giving me a bit of issues with mouse control. While yes the mouse position is indeed moving in the direction I am moving my mouse physically, it is moving at a different rate. I am wandering how one would deal with this? my screen is 800/600 and my view transform matrix is 600 units away on the z axis, looking at everything from a distance.

As Steve said, if you are using a perspective matrix, you need to translate your screen coordinates to world coordinates. look up UnProject/Project functions to accomplish this for generic perspective/view matrixs.

#1slicer4ever

Posted 04 April 2013 - 01:39 AM

I'm in the process of making a 2d game, and have made a transition from using d3d's 2D scene to just using 3d quads, however this is giving me a bit of issues with mouse control. While yes the mouse position is indeed moving in the direction I am moving my mouse physically, it is moving at a different rate. I am wandering how one would deal with this? my screen is 800/600 and my view transform matrix is 600 units away on the z axis, looking at everything from a distance.

As Steve said, if you are using a perspective matrix, you need to translate your screen coordinates to world coordinates. look up unProject/Project functions to accomplish this.

PARTNERS