XNA Camera Issues
Hello,
I have been playing around with a camera system that will rotate around a given target. I can get the camera to rotate around the object if it is not moving. Once the object moves, I can not get the object to rotate around the object. It will rotate and keep the target in view but wont rotate around the object. This might not sound like a good example but you can see what im talking about at my Blog. Here is a sample of my code for the camera
movement *= (moveRate * timeDelta);
rotationMatrix = Matrix.Identity;
Matrix.CreateRotationY(MathHelper.ToRadians(cameraYaw), out rotationMatrix);
if (movement != Vector3.Zero)
{
cameraPosition += movement;
}
Vector3.Transform(ref cameraPosition, ref rotationMatrix, out cameraPosition);
Matrix.CreateLookAt(ref cameraPosition, ref cameraTarget, ref cameraUpVector, out view);
The cameraTarget is the object.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement