Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBrother Bob

Posted 17 May 2013 - 04:05 AM

You need to use different coordinates for your vertices since the coordinate systems are completely different. For a given vertical FOV and aspect ratio, you can calculate the range in X and Y direction at a certain depth Z.

 

yrange = Z*tan(fov/2);
xrange = yrange*aspect;

The range of the coordinate system at depth Z is from -xrange to xrange in the X direction, and from -yrange to yrange in the Y direction.

 

But why do this and not use an orthographic projection for your 2D, and a perspective projection for your 3D?


#1Brother Bob

Posted 17 May 2013 - 04:04 AM

You need to use different coordinates for your vertices since the coordinate systems are completely different. For a given vertical FOV and aspect ratio, you can calculate the range in X and Y direction at a certain depth Z.

yrange = Z*tan(fov);
xrange = yrange*aspect;

The range of the coordinate system at depth Z is from -xrange to xrange in the X direction, and from -yrange to yrange in the Y direction.

 

But why do this and not use an orthographic projection for your 2D, and a perspective projection for your 3D?


PARTNERS