我如何使用鼠标滚轮缩放,我试试这个
if (currentMouseState.ScrollWheelValue < originalMouseState.ScrollWheelValue)
{
cameraPosition += new Vector3(0, -1, 0);
UpdateViewMatrix();
currentMouseState.ScrollWheelValue.Equals(0);
}
if (currentMouseState.ScrollWheelValue > originalMouseState.ScrollWheelValue)
{
cameraPosition += new Vector3(0, 1, 0);
UpdateViewMatrix();
currentMouseState.ScrollWheelValue.Equals(0);
}
但是即使我滚动一次,我也会继续放大,而且我对 XNA 有点陌生。请帮忙。