# What's the relationship between Dolly and Zoom?

**URL:** https://discourse.vtk.org/t/whats-the-relationship-between-dolly-and-zoom/6026
**Category:** Support
**Created:** [June 21, 2021, 3:00pm UTC](https://discourse.vtk.org/t/whats-the-relationship-between-dolly-and-zoom/6026 "2021-06-21T15:00:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [June 21, 2021, 3:00pm UTC](https://discourse.vtk.org/t/whats-the-relationship-between-dolly-and-zoom/6026/1 "2021-06-21T15:00:57Z")

</div>

`vtkCamera` has two methods for zoom in/out: `Dolly` and `Zoom`. What’s relationship between `Dolly` and `Zoom`?

Moreover, for `vtkCamera::Dolly(dolly)` and `vtkCamera::Zoom(zoomfactor)`, how to convert the `dolly` to `zoomfactor`?

---

<div class="post-metadata">

### Author: ![Andrew](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andrew/32/3861_2.png) [@Andrew](https://discourse.vtk.org/u/Andrew)
#### Post date: [June 21, 2021, 6:45pm UTC](https://discourse.vtk.org/t/whats-the-relationship-between-dolly-and-zoom/6026/2 "2021-06-21T18:45:41Z")

</div>

Documentation Answer:

```auto
Dolly(double value): Divide the camera's distance from the focal point by the given dolly value

Zoom(double value): In perspective mode, decrease the view angle by the specified factor.

```

So Dolly moves the eye position closer to the focal point. Whereas zoom actually just changes the field of view. Causing more perspective divide when doing perspective projection (so the image is more warped, looking down hallway, sides pinched in effect).

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [June 22, 2021, 5:58am UTC](https://discourse.vtk.org/t/whats-the-relationship-between-dolly-and-zoom/6026/3 "2021-06-22T05:58:43Z")

</div>

Thank you for your kindly reply. I have an additional question.

How can I increase size of image equal to 100%, 200%?

For 100%, I mean one screen pixel indicate 1 mm.  
For 200%, I mean one screen pixel indicate 0.5 mm.

If I want one screen pixel indicate 1 mm, how to calculate the distance between camera focal point and camera position?

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [June 22, 2021, 12:09pm UTC](https://discourse.vtk.org/t/whats-the-relationship-between-dolly-and-zoom/6026/4 "2021-06-22T12:09:29Z")

</div>

I using the following code to calculate the resolution:

```
    worldPoint0 = computeDisplayToWorld(0, 0)
    worldPoint1 = computeDisplayToWorld(0, 1)
    factor = norm(worldPoint1 - worldPoint0)

```

The `factor` indicates the distance that one screen pixel represent.

Then, I calculate the distance between camare focal point and camera position:

```
    cameraPosition = getCameraPosition()
    cameraFocalPoint = getCameraFocalPoint()
    distance = norm(cameraPosition - cameraFocalPoint)

```

Then, I find `distance/factor` is a constant value when I zoom in/out the image.

Am I correct?

In addition, when the vtk window size is changed, the `distance/factor` is also changed.
