Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

C# SharpDX how to rotate camera around the target

$
0
0
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.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>