Sign in to follow this  
jbperrin

D3DXMatrixOrthoLH vs 3D Studio Max

Recommended Posts

jbperrin    122
I am trying to match the camera settings in DirectX with those in a 3D Studio Max scene. The camera in max has an FOV parameter, yet the function D3DXMatrixOrthoLH does not take an FOV as a parameter. I am using an orthographic camera in max, and when I change the FOV in max, it zooms the scene in/out. So how can I achieve the same zooming/FOV effect in DirectX? I am currently calling D3DXMatrixOrthoLH such as: D3DXMATRIXA16 matProj; D3DXMatrixOrthoLH( &matProj, 800.0f, 600.0f, 0.0f, 1000.0f ); g_direct3DDevice9->SetTransform( D3DTS_PROJECTION, &matProj ); ...where 800.0f is the width of the scene in pixels and 600.0f is the height. Then 0.0f and 1000.0f specify the near and far clipping planes. Changing the near/far planes does not perform any kind of zoom/FOV functionality, as expected. Why would it. And max always renders out at the same width and height in pixels no matter what the FOV changes to. So I assume I must leave the D3DXMatrixOrthoLH call alone, and perform scaling on my scene, perhaps in the view matrix, to match the FOV. But if that's correct, how can I scale the scene according to an FOV value? How is max doing it?

Share this post


Link to post
Share on other sites
Tom KQT    1704
Ortho cameras don't have FOV. As I see you really can set camera in 3dsmax to use ortho projection and even then change FOV. But how is it related to the camera behaviour, who knows.
Notice that even when you set the camera to ortho, it still looks like a perspective camera in the viewports - it still have the pyramid frustrum.

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