Jump to content
  • Advertisement
Sign in to follow this  
impulsionaudio

orthographic projection issue

This topic is 3623 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

When I render using an orthographic projection, the image is much smaller (or distant) than when rendering using perspective projection. Here is the code: D3DXMATRIX camera; D3DXMatrixLookAtLH(&camera, &pos, &forward, &up); SetTransform(D3DTS_VIEW, &camera); if(perspective) D3DXMatrixPerspectiveFovLH(&camera, fov, aspectRatio, nearPlane, farPlane); else D3DXMatrixOrthoLH(&camera, width, height, nearPlane, farPlane); SetTransform(D3DTS_PROJECTION, &camera) Is there anything apparently wrong? Thanks

Share this post


Link to post
Share on other sites
Advertisement
With orthographic projection everything will be the same size on-screen no matter how far away it is, since it's on-screen size is entirely defined by the width and height of the projection. With perspective projection an object could be smaller than a pixel or could take up the entire screen, depending on how far away it is from the camera.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
With orthographic projection everything will be the same size on-screen no matter how far away it is, since it's on-screen size is entirely defined by the width and height of the projection. With perspective projection an object could be smaller than a pixel or could take up the entire screen, depending on how far away it is from the camera.


Thanks for the response. A second look at the DirectX orthographic matrix cleared things up.

Share this post


Link to post
Share on other sites
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!