Quaternions are annoying
I think you should keep it in a vector3. Here is what you should do:
First, create a Vector3 representing how much you want it to move:
Vector3 movement = new Vector3(0f, 0f, 5f); // 5f is the amount of movement. This means that if there was no rotation, it would move 5f across the z-axis
Then, create a Matrix for the rotation:
Matrix RotationMatrix = Matrix.CreateRotationX(Rotation.X) * Matrix.CreateRotationY(Rotation.Y) * Matrix.CreateRotationZ(Rotation.Z);
This assumes that your rotation is stored in a Vector3 called Rotation, and creates a rotation matrix based off of it.
Finally, transform your movement vector by the RotationMatrix:
movement = Vector3.Transform(movement, RotationMatrix);
Then, you add the resulting Vector3 (movement) to the position (this assumes that your Vector3 representing your position is stored in "position")
position += movement;
So, here's the code all in one block:
| Vector3 Movement = new Vector3(0f, 0f, 5f); // The amount of movement forward |
| // Create the rotation matrix |
| Matrix RotationMatrix = Matrix.CreateRotationX(Rotation.X) * |
| Matrix.CreateRotationY(Rotation.Y) * |
| Matrix.CreateRotationZ(Rotation.Z); |
| // Apply it to our vector |
| Movement = Vector3.Transform(Movement, RotationMatrix); |
| // And add the resulting vector to our position |
| Position += Movement; |
If you want to move with respect to GameTime, replace the first line with this:
Vector3 Movement = new Vector3(0f, 0f, 5f * (float)(gameTime.ElapsedRealTime.TotalMilliseconds / 1000));
where 5f is the speed per second
Quanternions are really confusing to me, whereas this can be done quite easily and has worked for me in quite a few games. I'm not sure how much you know about 3D math, but I certianly don't care for that much brainpower. If you just use vectors, then it is simple and easy to debug.