Jump to content
  • Advertisement
Sign in to follow this  
matt77hias

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

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
Advertisement

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  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!