(In C#/XNA 4.0)
I have Vector3 cameraPosition, Vector3 targetPosition
I want to have my camera look at the target, always 'facing' it, but never rolling
So roll always is neutral, to view the target the camera always either adjusts pitch or yaw
I've tried countless combinations of methods and information I find here and on the web but I haven't found anything that works properly. I think my issue may be my 'Up' vector (which I've tried .Up, 1,0,0, 0,1,0, 0,0,1)
When I move my camera I do:
CameraPosition += moveSpeed * vectorToAdd;
UpdateViewMatrix();
UpdateViewMatrix() is.. well, I've tried everything I have seen. At most simple...
View = Matrix.CreateLookAt(CameraPosition, targetPosition, upVector);
Where upVector has been Vector3.Up, 1, 0, 0; 0, 1, 0; 0, 0, 1, or other more 'proper' attempts to get my actual up vector. This sounds like it's probably my problem..
This should be dead simple, help!