0
\$\begingroup\$

How can calculate perspective camera parameters from orthographic camera parameters (left, right, top, bottom, near, far)?

Specifically I don't know how calculate the FOV for a perspective camera from orthographic camera.

\$\endgroup\$
  • 2
    \$\begingroup\$ You should create a question (or edit this one) that describes the feature that you need instead of asking about solution implementation. (XY problem) This way we could give you better answers. \$\endgroup\$ – Alexandre Vaillancourt Jun 17 '16 at 15:19
  • \$\begingroup\$ In theory, if your perspective FOV will be infinitely small, then said perspective matrix will kind of resemble orthographic matrix .. but I'm sure you need something less "extreme". \$\endgroup\$ – Kromster Jun 17 '16 at 15:34
  • \$\begingroup\$ I need way to get data for creation perspective camera (fov ,aspect,near,far , matrix) if I have data for creation orthographic camera (left, right, top, bottom, near, far, matrix). \$\endgroup\$ – Volodymyr Gnatiuk Jun 17 '16 at 15:46
  • \$\begingroup\$ What are these matrices? The way to project stuff on screen is by using lots of matrices, so just saying 'matrix' adds some confusion... \$\endgroup\$ – Alexandre Vaillancourt Jun 17 '16 at 16:17
  • \$\begingroup\$ Matrix determine position of camera and direction of camera view. \$\endgroup\$ – Volodymyr Gnatiuk Jun 17 '16 at 16:25
6
\$\begingroup\$

You can't.

The two matrices are constructed in completely different ways.

There are tons of ways to find more information on that by googling.

You can't get the field of view from the orthographic camera because there is no such thing.

\$\endgroup\$
  • \$\begingroup\$ Isn't there a hackish way to get the fov? Like 0.5f * (right - left) / (far - near) which would give us 0.5f * tan(fov) (which we can use to make perspective matrix given a ratio)? Though the view will be completely different from the ortho one ofc.. \$\endgroup\$ – Greffin28 Jun 17 '16 at 15:32
  • \$\begingroup\$ One could hackishly try to approximate the volume rendered; not sure about how I'd go about it exaclty, but you're right, the views would look different. \$\endgroup\$ – Alexandre Vaillancourt Jun 17 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.