In the world coordinate system, both the geometry and the camera are defined relative to the world coordinate system. However, when the camera is positioned and facing arbitrarily, the projection transformation and other types of changes are slightly difficult or inefficient. To simplify the operation, we change the camera to the world coordinate system origin and rotate it so that the optical axis of the camera is in the same direction as the z axis of the world coordinate system. At the same time, all geometries in world space are transformed with the camera to ensure constant camera vision. This transformation is called the framing transform (view space transformation), and we call the transformed geometry in the viewing coordinate system (view space).
Suppose the camera is located (5,3,-10) and its observer point is the origin of the World coordinate system (0,0,0), we can create a framing transformation matrix like this.
5.0f,3.0f,-10.0f); // The position of the camera in the world sitting system D3dxvector3 Target (0.0f0.0f0.0f// observed point d3dxvector3 up ( 0.0f1.0f0.0f// the upward direction vector d3dxmatrix V in the world coordinate system ; D3DXMATRIXLOOKATLH (&v, &position, &target, &up); // get the matrix of the framing change, i.e. the observation matrix
Framing transformations
// Framing Transformations
DirectX 3d Framing Transform