Jump to content
  • Advertisement
Sign in to follow this  

NDC-to-view matrix for both perspective and orthographic cameras

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

Is it possible to construct a 4x4 NDC-to-view matrix for both perspective and orthographic cameras? And how do these matrices look like (instead of blindly relying on some arbitrary matrix inverse method). I currently use a float4 to reconstruct my view space coordinates from NDC space coordinates. This reconstruction is, unfortunately, different for perspective and orthographic cameras, so I rather use a full matrix multiplication (assuming that such a matrix always exist for perspective and orthographic cameras).

Perspective projection:

view space coordinates           := [Vx, Vy, Vz, 1]

projection space coordinates := [Px, Py, Pz, Pw] = [Px, Py, Pz, Vz]

NDC space coordinates           := [Nx, Ny, Nz, 1] = [Px/Vz, Py/Vz, Pz/Vz, 1]

I guess not since we lost a degree of freedom after the homogeneous divide?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!