TerrainDisplay.Game1.UpdateCameraThirdPerson C# (CSharp) Method

UpdateCameraThirdPerson() private method

private UpdateCameraThirdPerson ( ) : void
return void
        void UpdateCameraThirdPerson()
        {
            // Create a vector pointing the direction the camera is facing.
            //var transformedReference = Vector3.Transform(, Matrix.CreateRotationY(avatarYaw));
            //transformedReference = Vector3.Transform(transformedReference, Matrix.CreateRotationX(avatarPitch));

            // Calculate the position the camera is looking from
            var target = avatarPosition + Vector3.Transform(Vector3.UnitZ, Matrix.CreateFromYawPitchRoll(avatarYaw, avatarPitch, 0));

            // Set up the view matrix and projection matrix
            _view = Matrix.CreateLookAt(avatarPosition, target, new Vector3(0.0f, 1.0f, 0.0f));

            var viewport = _graphics.GraphicsDevice.Viewport;
            var aspectRatio = viewport.Width/(float)viewport.Height;
            _proj = Matrix.CreatePerspectiveFieldOfView(ViewAngle, aspectRatio, NearClip, FarClip);
        }