开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜