# How to make vtkCamera to follow along a path? Similar to what we have in paraview.

**URL:** https://discourse.vtk.org/t/how-to-make-vtkcamera-to-follow-along-a-path-similar-to-what-we-have-in-paraview/6097
**Category:** Development
**Created:** [June 28, 2021, 3:43pm UTC](https://discourse.vtk.org/t/how-to-make-vtkcamera-to-follow-along-a-path-similar-to-what-we-have-in-paraview/6097 "2021-06-28T15:43:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vishalkumar2222](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vishalkumar2222/32/3622_2.png) [@vishalkumar2222](https://discourse.vtk.org/u/vishalkumar2222)
#### Post date: [June 28, 2021, 3:43pm UTC](https://discourse.vtk.org/t/how-to-make-vtkcamera-to-follow-along-a-path-similar-to-what-we-have-in-paraview/6097/1 "2021-06-28T15:43:49Z")

</div>

Hi,  
I have a requirement where I need to create my camera along a path. I have seen similar feature in paraview. How can I implement similar feature.

Thanks,

---

<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 28, 2021, 6:01pm UTC](https://discourse.vtk.org/t/how-to-make-vtkcamera-to-follow-along-a-path-similar-to-what-we-have-in-paraview/6097/2 "2021-06-28T18:01:49Z")

</div>

There might be something in VTK especially for it that I’m just not aware of but there’s tons of ways to do it.

A good start would be to code up a [vtk timer event](https://kitware.github.io/vtk-examples/site/Cxx/Utilities/Timer/) and slowly move it in there. ie: Just modifying the camera position and focal point forward along a straight path. Then call render on the window again.

Then you could start defining curved paths with splines. Or line mesh paths with slerps on the camera.

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [June 30, 2021, 11:40am UTC](https://discourse.vtk.org/t/how-to-make-vtkcamera-to-follow-along-a-path-similar-to-what-we-have-in-paraview/6097/3 "2021-06-30T11:40:21Z")

</div>

FYI It’s probably useful to become familiar with the vtkQuaternionInterpolator class (and related).

---

<div class="post-metadata">

### Author: ![vishalkumar2222](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vishalkumar2222/32/3622_2.png) [@vishalkumar2222](https://discourse.vtk.org/u/vishalkumar2222)
#### Post date: [June 30, 2021, 11:44am UTC](https://discourse.vtk.org/t/how-to-make-vtkcamera-to-follow-along-a-path-similar-to-what-we-have-in-paraview/6097/4 "2021-06-30T11:44:25Z")

</div>

Thanks Guys, I got it working. I used vtkCameraInterpolator class.
