Hi guys

Ive been experimenting with the xna skinning sample(link below) and have begun trying to implement controller/keyboard input, right now Im able to move the model forward,backwards, left, and right but after different approaches I havent been able to find info on how to get the model to face the direction in which it is moving if anyone could point me in the right direction on how this is done it would be much appreciated.(the code I have so far is below)

Thankyou

skinning sample link

http://xbox.create.msdn.com/en-US/education/catalog/sample/skinned_model

below is what I have so far in the draw method

protected override void Draw(GameTime gameTime) { GraphicsDevice device = graphics.GraphicsDevice; device.Clear(Color.CornflowerBlue); Matrix[] bones = animationPlayer.GetSkinTransforms(); for (int i = 0; i < bones.Length; i++) { bones[i] *= Matrix.CreateRotationX(Rotation.X) //Computes the rotation * Matrix.CreateRotationY(Rotation.Y) * Matrix.CreateRotationZ(Rotation.Z) * Matrix.CreateTranslation(position) * Matrix.CreateWorld(Translation, Vector3.Forward, Vector3.Up); //Move the models position } Matrix[] modelTransforms = new Matrix[currentModel.Bones.Count]; currentModel.CopyAbsoluteBoneTransformsTo(modelTransforms); // Render the skinned mesh. foreach (ModelMesh mesh in currentModel.Meshes) { foreach (Effect effect2 in mesh.Effects) { effect2.Parameters["Bones"].SetValue(bones); effect2.Parameters["View"].SetValue(camera.viewMatrix); effect2.Parameters["Projection"].SetValue(camera.projectionMatrix); } mesh.Draw(); DrawCity(); drawDebug(); fine1(); } base.Draw(gameTime); }

this is what I have so far for the input method

private void HandleInput(GameTime gameTime) { KeyboardState currentKeyboardState = Keyboard.GetState(); // Check for exit. if (currentKeyboardState.IsKeyDown(Keys.Escape)) { Exit(); } float speed = 0.02f; //Dictates the speed if (currentKeyboardState.IsKeyDown(Keys.Left)) { position.Z -= speed * (float)gameTime.ElapsedGameTime.TotalMilliseconds; } if (currentKeyboardState.IsKeyDown(Keys.Right)) { position.Z += speed * (float)gameTime.ElapsedGameTime.TotalMilliseconds; } if (currentKeyboardState.IsKeyDown(Keys.Up)) { position.X += speed * (float)gameTime.ElapsedGameTime.TotalMilliseconds; } if (currentKeyboardState.IsKeyDown(Keys.Down)) { position.X -= speed * (float)gameTime.ElapsedGameTime.TotalMilliseconds; } }