Notifications
Clear all

[Closed] Dolly Zoom (Vertigo Effect) with Vray Physical Camera

I’ve tried doing this with a scripted controller at the VrayCam’s FOV using the same method as a standard max camera but I think since the VrayCam has different parameters it’s causing it to not work? Any ideas?

I used the method from this thread :

*Create some objects to have something visible in the scene.
*Create a TARGET Camera (a free camera would be tricky) looking at these objects
*Open the TrackView and select the FOV track of the Camera
*Right-click, Assign Controller > Float Script
*Enter the following script:

dependsOn $Camera01
degToRad ( 2*atan(200/($Camera01.targetDistance)))

where
*$Camera01 is the exact name of the camera you created
*200 is half the width in world units of the projection plane at the camera target (400 is the complete width)
*The result of atan(200/($Camera01.targetDistance))) is the half-FOV angle, so we have to multiply it by 2 to get the full FOV
*degToRad converts the result from degrees to radians

12 Replies

Nobody has any ideas?

Can’t you just do it with a regular camera and wire the FOV to the VRayCam’s FOV?

It works by using the distance from the camera to the camera target so I don’t think that would work. the length of the focal plane also comes into play and I can’t figure out how to get that to work like it does with the standard max camera.

Try this:

$vrayCam.specify_fov = on

In the FOV Script Controller use this formula:

2*atan(200/($vrayCam.targetDistance))

Where vrayCam is the name of your Vray camera.

This works but the specify focus doesn’t seem to make a difference. Also, it keeps the area where the camera target is at locked in the same place in the frame – but I need the borders of the image to remain locked. So if you’re looking through a window and the window frame is the border of the image, it should stay locked in place and everything beyond should warp depending on the fov and dolly.

1 Reply
(@polytools3d)
Joined: 11 months ago

Posts: 0

I am not sure to understand what you are saying. Have you set the .specify_fov property of the camera to on?

Forget what I said about specify focus – I thought you meant that instead of specify FOV.

Yes I have specify FOV checked.

First of all – the script seems to work better with values much lower than 200 – like 30 for instance.

Second of all – after creating the script controller, the objects in the foreground don’t stay in the same position like I need and like what you would expect from a real life dolly zoom. Instead with this script controller the objects in the background stay in the same position, which is incorrect

1 Reply
(@polytools3d)
Joined: 11 months ago

Posts: 0

I though you wanted the Controller Script to work on a VRay camera as it does with a Max camera, and as far as I could test, the code I posted works the same.

I haven’t created the math for it, it was from your reference, so if a value of 30 works better for you, then you can use it.

see attached screenshot. when moving the camera back and forth, the fov triangle should stay locked on the focal plane.

1 Reply
(@polytools3d)
Joined: 11 months ago

Posts: 0

What you see (the images you showed), is a redraw issue. Click again on the camera and you will see the updated “camera cone”.

2*atan($vrayCam.film_width/($vrayCam.targetDistance))

This seems to look good for me.

2*atan($vrayCam.film_width/($vrayCam.targetDistance))

This seems to look good for me.

Yes! That does indeed seem to work. Thanks so much!

This is what I have for a simple script by the way:

thecamera=$
thecamera.fov.controller = float_script()
thecamera.fov.controller.script = "2*atan($" + (thecamera.name) + ".film_width/($" + (thecamera.name) + ".targetDistance))"