# Programmatic Volume File Zooming

**URL:** https://discourse.vtk.org/t/programmatic-volume-file-zooming/7389
**Category:** Web
**Created:** [December 13, 2021, 11:47am UTC](https://discourse.vtk.org/t/programmatic-volume-file-zooming/7389 "2021-12-13T11:47:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [December 13, 2021, 11:47am UTC](https://discourse.vtk.org/t/programmatic-volume-file-zooming/7389/1 "2021-12-13T11:47:03Z")

</div>

I’m rendering a VTI file on browser. I can zoom-in/zoom-out using my mouse scroll wheel. I want to apply zooming from the code itself similar to the one that applies with scroll wheel. But couldn’t find the required api/function for same. Can anyone points me to some reference or example ?

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [December 16, 2021, 12:12pm UTC](https://discourse.vtk.org/t/programmatic-volume-file-zooming/7389/2 "2021-12-16T12:12:31Z")

</div>

I have tried using the dolly in camera parameters but it doesn’t helps. On setting the value 0 in dolly I’m getting normal image. However for all other values nothing is shown on the render window. Any idea what am I missing ?

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [January 6, 2022, 5:59pm UTC](https://discourse.vtk.org/t/programmatic-volume-file-zooming/7389/3 "2022-01-06T17:59:01Z")

</div>

It sounds like you are in parallel projection. In that case, use the `setParallelScale(value)` function of the camera to achieve zoom.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [January 7, 2022, 11:49am UTC](https://discourse.vtk.org/t/programmatic-volume-file-zooming/7389/4 "2022-01-07T11:49:38Z")

</div>

Thanks @Forrest for reply. The issue resolved by calling resetCameraClippingRange() function of the renderer after applying the parameter.
