Original Post
im creating a simple camera in c#/xna. i am trying to implement the standard fps WSAD layout with mouse controlling where you look, with A being strafe left and D being strafe right. Below is an excerpt of the code i am looking over this seems contrary to reason as the positive X axis runs to the right and the negative X axis runs to the left. why then do we subtract from the X when moving to the right and add to the X when moving to the left?
public void update(float delta_time)
{
KeyboardState kState = Keyboard.GetState();
MouseState mState = Mouse.GetState();
Vector3 moveVector = Vector3.Zero;
if (kState.IsKeyDown(Keys.W))
{
moveVector.Z += 3.0f * deltaTime;
}
if (kState.IsKeyDown(Keys.S))
{
moveVector.Z -= 3.0f * deltaTime;
}
if (kState.IsKeyDown(Keys.A))
{
moveVector.X += 3.0f * deltaTime;
}
if (kState.IsKeyDown(Keys.D))
{
moveVector.X -= 3.0f * deltaTime;
}
}