XNA Rotate Camera Around It's CreateLookAt "Target"
How to rotate camera around it's CreateLookAt() "Target" Vector3 position as pivot point, so the camera will "rotate around" that pivot point and always "facing" to that pivot point.
Please kindly answer, thank yo开发者_JS百科u
assuming you have your rotation axis and angle already:
cameraPosition = Vector3.Transform(cameraPosition - cameraTarget, Matrix.CreateFromAxisAngle(axis, angle)) + cameraTarget;
view = CreateLookAt(cameraPosition, cameraTarget, cameraUp);
This rotates the camera's position around the target and resets the view matrix appropriately.
精彩评论