Example #1
0
        public void Update(Vector3 position)
        {
            base.Update();

            ViewVector = Vector3.Transform(Target - position, Matrix.CreateRotationY(0));
            ViewVector.Normalize();
            Forward.Normalize();
            View = Matrix.CreateLookAt(position, position + Forward, Vector3.Up);
        }
        /// <inheritdoc />
        public override void Update(GameTime gameTime)
        {
            CameraPosition = Distance * new Vector3((float)Math.Sin(Angle), 0, (float)Math.Cos(Angle));
            ViewVector     = Vector3.Transform(CameraTarget - CameraPosition, Matrix.CreateRotationY(0));
            ViewVector.Normalize();

            Angle += 0.002f;
            View   = Matrix.CreateLookAt(CameraPosition, CameraTarget, Vector3.UnitY);

            base.Update(gameTime);
        }