Hello,
so I wanted screen panning for my editor. Hope thats even the right term, I click my mouse and the camera moves parallel to the screen as I drag the mouse. So thats what I've got so far:
D3DXVECTOR3 vDist3(0.0f, (float)vDist.y, -(float)vDist.x);
m_pCamera->Pan(vDist3);
Yeah, so if I look straight on the X-Axis this works fine, but as you can quess, as soon as I rotate the camera it doesn't work as expected.
Now I could use the law of sine to calculate two components of rotation along the x and z-axis, make a rotation matrix and transfer the vector with it, then somehow take into consideration the up-vector, etc... but I quess there is an easier solution using the view-matrix, isn't there? If so, how could this be done (I tried multiplying both the normal and inverse view matrix, but that just makes causes the camera to "zoom" out of the scene in huge steps)?