|XNA 4.0 Third Person Camera Demo.
This Windows XNA application implements a third person style camera. A ThirdPersonCamera class is provided that implements the third person camera.
The camera and the 3D model are attached to each other by a spring. As the user moves the 3D model around the scene the camera is dragged along with it. When the user stops moving the 3D model the camera slowly moves back to its resting position behind the 3D model.
The purpose of the spring system in the third person camera is to smooth out the camera movement. If you disable the camera spring system in the demo the camera will instantly snap to its new position in response to the user's input.
The behavior of the spring system is governed by the spring's stiffness. The less stiff the spring the more laggy the camera becomes. Increasing the spring's stiffness will make the camera less laggy. The correct spring stiffness will depend on your application. However very small stiffness values will cause the camera to lag too far behind the 3D model, and very large stiffness values will negate the spring damping effect on the camera.
1. This demo requires shader model 2.0 or higher support.
2. This demo is provided in source form only. No pre built binaries are supplied.
Download source, assets, and XNA Game Studio 4.0 solution files.
15 January 2011.
Initial release of demo for XNA Game Studio 4.0. The previous XNA Game Studio 3.0 version of the demo is no longer supported and is now only available upon request.
16 November 2008.
Initial release of demo for XNA Game Studio 3.0. The previous XNA Game Studio 2.0 version of the demo is no longer supported and is now only available upon request.
10 April 2008.
blinn_phong.fx: Fixed a bug in the PS_PointLighting() and PS_SpotLighting() functions where the computed light attenuation was not being clamped.