• Advertisement
Sign in to follow this  

Cannot compute wNear and wFar from projection matrix

This topic is 2151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm developing an application in Direct3D9, and the Debug runtime spews the titular error when I attempt to set my projection matrix. I've got the following code:

[color=#000000]D3DXMatrixPerspectiveFovLH(
&Projection,
D3DXToRadian(90),
(float)GetDimensions().x / (float)GetDimensions().y,
NearPlane,
FarPlane
);
D3DCALL(device->SetTransform(
D3DTS_PROJECTION,
&Projection
));


I checked in advance, and I have only one thread, the x and y values are 1920 and 1018 (the dimensions of the client area of my window), and the NearPlane is 0.1f and the FarPlane is 40.0f- I confirmed these values by breakpoint. The only times I've seen this error previously, and the only causes I could find via Google, were when the NearPlane is 0, which is not the case here.

Edit: Never mind, my own silly fault. I accidentally used a bad pointer to call this function.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement