I'm making a 3D game in XNA using Ox Engine. There is very little documentation and I have been surviving thus far, but now I've hit a logical road block for a good while and I think it's time to ask for outside help.
All movement and mouse look x work and the camera follows properly however when I move the mouse up/down on the Y axis to make the camera move in its circling "bubble" around the character it causes everything else to go out of sync. The character should orbited by the camera, but it also needs to be told what direction the character is facing. I cannot seem to have both.
When I have the code to tell it the direction of the character and move "away"(transpose) from it, it's moving the orbit itself:
if (changeY > 0)
{
if (camMemory.Y > 110)
tempMatrix *= Matrix.CreateFromAxisAngle(model.Orientation.Left, MathHelper.ToRadians(changeY));
}
else if (changeY < 0)
{
if (camMemory.Y < 400)//FAKE PLACEHOLDER VALUE... highest point in arc goes here
tempMatrix *= Matrix.CreateFromAxisAngle(model.Orientation.Left, MathHelper.ToRadians(changeY));
}
Vector3 camPos = new Vector3(0, 0, 0) ;
camMemory = tempMatrix.Translation;
//NOTE: this is the piece that causes the "bubble" to move
moveAmount = tempMatrix.Forward * 200f;
/////
tempMatrix.Translation += moveAmount;
camPos = tempMatrix.Translation + model.Position;
//Pointer in front, Camera behind, make camera face pointer.
Engine.Camera.SetTransformByLookTarget(camPos, model.Orientation.Up, trackPos);
This means that by not properly orbiting the character, when he turns the camera is out of place.
However when I remedy this problem I am not far enough away from the character to have a proper view and simply multiplying upon tempMatrix.Translation to 'widen' the 'bubble' causes me to be severely out of place. I am bereft of epiphanies. Any insights would be greatly appreciated.
tl,dr: How do I make the orbiting camera bubble around the character bigger without moving the center point (transpose isn't working or I'm using it wrong!)
Edit: I wish I could put a bounty on this, lol