Jump to content
  • Advertisement
Sign in to follow this  
DeadMG

Cannot compute wNear and wFar from projection matrix

This topic is 2450 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!