title: how to move 3d object in XNA?
body: <p>I want to move a 3d car model, when I press the left or right arrow key I change the angle, when I press the up arrow the car drives.</p>
  
  <p>This is the code in the update method:</p>
  
  <pre><code>float dirX = (float)Math.Sin(angle);
  float dirY = (float)Math.Cos(angle);
  
  if (Keyboard.GetState().IsKeyDown(Keys.Up))
          {
              position += new Vector3(-dirX, dirY, 0);
  
              if (Keyboard.GetState().IsKeyDown(Keys.Left))
              {
                  angle += 0.015f;
              }
  
              if (Keyboard.GetState().IsKeyDown(Keys.Right))
              {
                  angle -= 0.015f;
              }
          }
  </code></pre>
  
  <p>This is the calculating part, but obviously I also need to move the car on the screen. 
  I want the car to move forward, not up, so I thought I should rotate it 90 degrees on the X axis, and also I want to rotate the car when I press the left or right keys. </p>
  
  <p>I wrote this code:</p>
  
  <pre><code>world = Matrix.CreateTranslation(position) * Matrix.CreateRotationY(angle) * Matrix.CreateFromAxisAngle(Vector3.UnitX, MathHelper.ToRadians(-90));
  </code></pre>
  
  <p>This code isn't working, can anybody tell me how can I move it?</p>