Example #1
0
        protected override void OnKeyDown(KeyboardKeyEventArgs e)
        {
            base.OnKeyDown(e);

            // camera position
            if (e.Key == Key.Up)
            {
                camera.MoveForward();
            }
            else if (e.Key == Key.Down)
            {
                camera.MoveBackward();
            }
            else if (e.Key == Key.Left)
            {
                camera.MoveLeft();
            }
            else if (e.Key == Key.Right)
            {
                camera.MoveRight();
            }
            else if (e.Key == Key.B)
            {
                if (blinn == 0)
                {
                    blinn = -1;
                }
                else
                {
                    blinn = 0;
                }
            }
        }