You are passing to the D3DXMatrixLookAtLH()
function the address of temporary D3DXVECTOR3
objects.
Instead, try building these instances of D3DXVECTOR3
on the stack, and pass their addresses, e.g.:
D3DXVECTOR3 cameraPos(0.0f, 8.0f, 25.0f);
D3DXVECTOR3 lookAtPos(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 upDir(0.0f, 1.0f, 0.0f);
// Assume that you have properly defined matView
D3DXMatrixLookAtLH(
&matView,
&cameraPos,
&lookAtPos,
&upDir);