This is the code that I am using for moving the camera:

Code:

public static void SetCamera(Vector3 cPosition, float h, float v)
{
cameraPosition = cPosition;
cameraTarget = new Vector3();
cameraUpVector = new Vector3();
hRadians = h;
vRadians = v;
RotateCamera(0, 0);
}
public static void RotateCamera(float h, float v)
{
hRadians += h;
vRadians += v;
cameraTarget.Y = cameraPosition.Y + (float)(radius * Math.Sin(vRadians));
cameraTarget.X = cameraPosition.X + (float)(radius * Math.Cos(vRadians) * Math.Cos(hRadians));
cameraTarget.Z = cameraPosition.Z + (float)(radius * Math.Cos(vRadians) * Math.Sin(hRadians));
cameraUpVector.X = cameraPosition.X - cameraTarget.X;
cameraUpVector.Y = Math.Abs(cameraPosition.Y + (float)(radius * Math.Sin(vRadians + Math.PI / 2)));
cameraUpVector.Z = cameraPosition.Z - cameraTarget.Z;
}
public static void SlideCamera(float h, float v)
{
cameraPosition.Y += v * moveDist;
cameraPosition.X += h * moveDist * (float)Math.Cos(hRadians + Math.PI / 2);
cameraPosition.Z += h * moveDist * (float)Math.Sin(hRadians + Math.PI / 2);
RotateCamera(0, 0);
}
public static void MoveCamera(float d)
{
cameraPosition.Y += d * moveDist * (float)Math.Sin(vRadians);
cameraPosition.X += d * moveDist * (float)(Math.Cos(vRadians) * Math.Cos(hRadians));
cameraPosition.Z += d * moveDist * (float)(Math.Cos(vRadians) * Math.Sin(hRadians));
RotateCamera(0, 0);
}

I got this code from gamedev.net. Is it possible to modify the code so that I can only move along a specific axis, so that I don't move up when I look up?