Forum rules - please read before posting.

Transition between orthographic and perspective cameras

Wondering if it's possible to transition (smoothly) between an orthographic view and a perspective one - presumably the effect would look similar to when you toggle the "2D" button in Unity. I tried setting up two cameras (one persp, one ortho) and using the Switch action over time, but it produces a very hard cut from the orthographic projection type to the perspective one, and then smoothly adjust between the two Transform positions. Am I going about it wrong, or is that just way too hard to do, since it would involve custom projection matrices(?)

Comments

  • It'd be a nightmare to try to do that, and I'm not sure it'd even be possible in a "pure" sense - i.e. there'd always a be a jump of some kind.

    You could try using a perspective camera with a really, really high FOV in place of an orthographic camera.
  • Ok, thanks - I'll do some playing around with FOV and try to get a better understanding of how it works. From initial tests, it actually seemed like lowering the FOV was getting me closer to something orthographic - not sure if that makes sense...
  • Hi there,

    AFAIK it's impossible to have a completely smooth transition between the two, as they're fundamentally different. You can get quite close, but there's always going to be a little bump in the transition. You can see the bump if you set up a Perspective Camera with a FOV of 1 (the minimum) really far away from your object, and toggle between Orthographic and Perspective projection mode in the Inspector (also remember to set the Orthographic Camera's "Size" parameter to something appropriate, so that everything is approximately the same size after the switch).

    If I'm understanding it correctly, part of what you're trying to do is the Dolly Zoom effect. The Unity documentation offers a read on this, along with some code. It doesn't offer anything on having a smooth switch from Ortho to Perspective, but it can take you from Perspective to 'almost' Ortho.

    Cheers
  • Thank you both for your help!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.