public override String keyboard(Keys keyCode, int x, int y)
 {
     StringBuilder result = new StringBuilder();
     switch (keyCode)
     {
         case Keys.D1:
             Rotate(Vector3.UnitX, 5f);
             break;
         case Keys.D2:
             Rotate(Vector3.UnitX, -5f);
             break;
         case Keys.D3:
             Rotate(Vector3.UnitY, 5f);
             break;
         case Keys.D4:
             Rotate(Vector3.UnitY, -5f);
             break;
         case Keys.D5:
             Rotate(Vector3.UnitZ, 5f);
             break;
         case Keys.D6:
             Rotate(Vector3.UnitZ, -5f);
             break;
         case Keys.I:
             result.AppendLine("Found " + ship.ObjectCount().ToString() + " objects in ship file.");
             break;
         case Keys.A:
             ship.SetProgram(defaultShader);
             break;
         case Keys.B:
             ship.SetProgram(shaderFragWhiteDiffuseColor);
             break;
         case Keys.Add:
             currentScale = Vector3.Multiply(currentScale, 1.05f);
             ship.Scale(currentScale);
             break;
         case Keys.Subtract:
             currentScale = Vector3.Divide(currentScale, 1.05f);
             ship.Scale(currentScale);
             break;
         case Keys.Space:
             if (addMissle == false)
             {
                 if (missles.Count < 10)
                 {
                     addMissle = true;
                 }
             }
             result.AppendLine("axis " + axis.ToString());
             result.AppendLine("up " + up.ToString());
             result.AppendLine("right " + right.ToString());
             result.AppendLine("missles.Count " + missles.Count.ToString());
             break;
         case Keys.NumPad1:
             Rotate(Vector3.UnitZ, 5f);
             break;
         case Keys.NumPad2:
             Rotate(Vector3.UnitX, -5f);
             break;
         case Keys.NumPad3:
             Rotate(Vector3.UnitZ, -5f);
             break;
         case Keys.NumPad4:
             Rotate(Vector3.UnitY, -5f);
             break;
         case Keys.NumPad5:
             if (addMissle == false)
             {
                 if (missles.Count < 10)
                 {
                     addMissle = true;
                 }
             }
             break;
         case Keys.NumPad6:
             Rotate(Vector3.UnitY, 5f);
             break;
         case Keys.NumPad7:
             Rotate(Vector3.UnitZ, 5f);
             break;
         case Keys.NumPad8:
             Rotate(Vector3.UnitX, 5f);
             break;
         case Keys.NumPad9:
             Rotate(Vector3.UnitZ, -5f);
             break;
         case Keys.S:
             Enemy enemy = new Enemy();
             enemies.Add(enemy);
             break;
     }
     return result.ToString();
 }
        protected override void init()
        {
            ship = new Blender();
            ship.ReadBinaryFile("xwng_with_normals.bin");
            ship.SetColor(Colors.WHITE_COLOR);

            ship.Scale(currentScale);

            enemies = new List<Enemy>();

            for (int i = 0; i < 10; i++)
            {
                Enemy enemy = new Enemy();
                enemies.Add(enemy);
            }

            deadenembyText = new TextClass("Dead enemby = " + deadEnemyCount.ToString(), 0.4f, 0.04f, staticText);
            deadenembyText.SetOffset(new Vector3(-0.75f, +0.8f, 0.0f));

            credit1 = new TextClass("X-Wing Model based on Blender model by", 0.4f, 0.04f, staticText);
            credit1.SetOffset(new Vector3(-0.75f, -0.65f, 0.0f));

            credit2 = new TextClass("Angel David Guzman of PixelOz Designs", 0.4f, 0.04f, staticText);
            credit2.SetOffset(new Vector3(-0.75f, -0.75f, 0.0f));

            SetupDepthAndCull();
            SetupShaders();
        }