I want to rotate my camera around the target horizontally and vertically. Example if q-e pressed only horizontally rotated. And when 1-2 pressed vertically rotated around its direction
Example Cameraview :
public Matrix View { get; set; }
public Vector3 eye { get; set; } = new Vector3(0, 0, -5);
public Vector3 target { get; set; } = new Vector3(0, 0, 0);
public Vector3 Translation = new Vector3(0, 0, 0);
View = Matrix.Translation(Translation.X, Translation.Y, Translation.Z)* Matrix.LookAtLH(eye, target, Vector3.UnitY);
I think rotation must be based on target point not the camera itself.
↧