Sign in to follow this  
DeadMG

Cannot compute wNear and wFar from projection matrix

Recommended Posts

DeadMG    100
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][code]D3DXMatrixPerspectiveFovLH(
&Projection,
D3DXToRadian(90),
(float)GetDimensions().x / (float)GetDimensions().y,
NearPlane,
FarPlane
);
D3DCALL(device->SetTransform(
D3DTS_PROJECTION,
&Projection
));[/code][/color]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this