Cannot compute wNear and wFar from projection matrix
- by DeadMG
I've got the following error from Direct3D when attempting to render in 3D:
Direct3D9: (WARN) :Cannot compute WNear and WFar from the supplied
projection matrix
Direct3D9: (WARN) :Setting wNear to 0.0 and wFar to 1.0
My projection matrix is as follows:
D3DXMatrixPerspectiveFovLH(
&Projection,
D3DXToRadian(90),
(float)GetDimensions().x / (float)GetDimensions().y,
NearPlane,
FarPlane
);
D3DCALL(device->SetTransform(
D3DTS_PROJECTION,
&Projection
));
The NearPlane is 0.1f, the FarPlane is 40.0f, and the dimensions are 1920x1018. This code was working earlier but I appear to have broken it, and I'm not sure where the fault is. Previously I've only encountered it if NearPlane was 0, and Google hasn't suggested any other causes either. Any suggestions?