I did not actively know about this 'Vertigo' effect until it was mentioned by my supervisor. Only after speaking with him did I realize that I have seen this effect in many movies. I thought it would be interesting to look into. I was specifically interested in how this would apply to the Oculus Rift and what sort of effect it would have on users when in use.
I started by looking into the Dolly Effect on Wikipedia (Wikipedia, 2015), as it gave a good overview with examples as well as the maths that went into creating the effect.
Converting the code into C# wasn't really required but I thought it would help me understand how they implemented the mathematics behind the concept better. And it did, converting the code did not take long at all.
The next step was attempting to get the effect to work on the DK2. I couldn't simply attach my dolly effect script to each Oculus camera as this broke the cameras during runtime. I had to instead modify the OVRCamera script that came with the Unity integration package. I did this by 'merging' my script with the OVRCamera script. Most of the merging was pretty straight forward stuff. Adding variable declarations to the top etc. The only really interesting part was that I had to make use of the LateUpdate() method rather than a normal Update method. As the rift updates differently than standard Unity Update(). Once this was in place, the code worked like a charm and the effect worked awesome! The code changes can be found below, summarized:
What was even more neat was the fact that I would attach the focal object in the scene via a public variable and doing so would give a different effect. Stretching towards the door (see blow video for example). Or skewing the door when heading towards a teddybear. or bursting through the door completely. It feels pretty trippy when this effect is used on the rift :D
Pretty fun stuff!
Wikipedia. (2015) Dolly zoom. [Online] Available from: http://en.wikipedia.org/wiki/Dolly_zoom [Accessed: 3 March 2015].
Unity Documentation. (2015) Dolly Zoom (AKA the “Trombone” Effect). [Online] Available from: http://docs.unity3d.com/Manual/DollyZoom.html [Accessed: 3 March 2015].
Youtube. (2015) Dolly Effect / Vertigo Effect on DK2 in Unity. Available from: https://www.youtube.com/watch?v=UfhAJR4cjzU [Accessed: 3 March 2015].