I am making a 3D game in XNA using the Ox Engine. There is very little documentation, and I still have survived, but now I have been on the logical road block for a long time, and I think it's time to ask for outside help.
All movements and mice look x, and the camera follows correctly, however, when I move the mouse up / down on the Y axis so that the camera moves in its circular βbubbleβ around the character, it forces everything else to go out of sync. The symbol should be in orbit on the camera, but it should also indicate what the character's direction is . It seems I don't have both.
When I have a code to tell him the direction of the character and move it βawayβ (transpose), he moves 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);
code>
This means that if the character is in the wrong orbit, when he turns the camera, this is inappropriate.
However, when I fix this problem, I am not far enough from the character to have the correct idea and just multiply by tempMatrix. Going to expand the bubble makes me totally out of place. I am deprived of epiphanes. Any ideas would be appreciated.
tl, dr : How to make the orbital camera bubble around the symbol more without moving the center point (transposition does not work, or I use it incorrectly!)
Edit: I'm sorry I can't put a bounty on it, lol