# Vertigo effect in maya

I want to create a kind of vertigo effect in maya. However if I key frame the first and last frame (distance and focal length) it's most of the time too far to one end.

I assume that the two are not linear and that I have to add some kind of formula to keep the values together.

There would be too many keyframes for it to be a comfortable option.

Is there a relationship between these two numbers that I can input somewhere in my animation?

Or are there curves that I could adjust in some way?

How could I do that?

My problem is the following: When I make a keyframes on the first and the last frame , the frame in the middle has a a far to large angle of view than it should be.

How can I tell Maya to calculate the in-between correctly?

On the left how it should be and on the right how it is.

The vertigo effect is also known as the dolly zoom https://en.m.wikipedia.org/wiki/Dolly_zoom

• What's a 'vertigo effect'? Vertigo is a feeling of dizziness, it doesn't describe what causes that feeling. [Many people confuse vertigo with acrophobia, which is a fear of heights, for which Hitchcock must take the blame] May 14, 2018 at 7:15
• The effect ist achieved by moving the camera closer to the object while simontaniusly zooming out so that the main object stays the same size relative to the viewer (so the only visible difference is the background warping) May 14, 2018 at 7:24
• It's also known as a dollyzoom May 14, 2018 at 7:25
• It's not really "also known as", it is a dolly-zoom, & the two should not be confused ;) May 14, 2018 at 7:39
• I wont give you an answer here since its the wrong place but if you drop by our chat room the ink spot i can give one for you May 14, 2018 at 8:57

I assume you want a non-moving background object to be scaled linearly(=same height or width increment or decrement in every frame interval, not same in percents but same in millimeters) during the run. The foreground object also doesn't move, but has a constant apparent size during the run.

Assuming the camera lens aperture to be so small that the image is sharp when the lens is focused to infinity, the ray geometry reduces to quite simple:

We have the camera in the left. A is the foreground object at distance D, B is the background object, the distance difference is S.

We compare computer screen images a and b of objects A and B. We use the same symbols for the heights. Symbol a means onscreen height of the foreground object which has real height A, etc...

Computer screen heights a and b are pretty much bigger than the sizes in the film. If the real focal length is =f, the imaging plane distance from the lens is N*f where N is the scaling factor from "on film image size" to "on screen image size"

Equations (1) and (2) are ordinary triangle proportion laws. (3) and (4) are the same equations, but solved to give needed camera distance D and focal length f.

(5) and (6) tell what actually is wanted. We have a series of video frames which covers our camera run. Frames are indexed v=0,1,2,...K. b0 is the inital onscreen height of B, every frame advance increases it by increment x. In the last frame (v=K) the onscreen size of B has grown from b0 to M*b0

I made Excel spreadsheet to calculate the right camera distance Dv and focal length fv for every frame of the run:

The yellow cells are the input area. There we have

• scaling factor = 20 ie. 18 mm high film frame vs. 360 mm high screen
• the foreground object is 1,5 meters high and shown as 240 millimeters high
• the background object is 5 meters further than the foreground object, its height is 1,5 meters, too and in the beginning it's shown as 100 mm high.
• in the end the background object has grown to 200 mm high onscreen, the growth rate is 2 millimeters per frame
• the run consists 51 frames ie. the initial frame (v=0) and then 50 more, the last frame has index v=50.

The camera distance grows. The speed increases. In the beginning the speed is about 130 mm per frame. In the end the speed is about 1,5 meters per frame. Start distance is = 3,5 meters, final distance is 25 meters

To keep the foreground object having the same onscreen size, the focal length grows from 28,6 mm to 200 mm

These numbers are unrealistic for a real run, but in computer all is possible. Without computers focal length growth can be replaced by enlargening.