D3DXMATRIX worldMatrix; device->GetTransform(D3DTS_WORLD, &worldMatrix);
D3DXMATRIX viewMatrix; device->GetTransform(D3DTS_VIEW, &viewMatrix);
D3DXMATRIX projMatrix; device->GetTransform(D3DTS_PROJECTION, &projMatrix);This code retrieves the current projection transformation matrix and stores it in the projMatrix variable. The package library for GetTransform is Microsoft DirectX SDK.