how to move 3d object in XNA?
问题 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. This is the code in the update method: 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; } } This is the calculating