# Update point in real time

**URL:** https://discourse.vtk.org/t/update-point-in-real-time/1129
**Category:** Support
**Created:** [June 13, 2019, 9:18pm UTC](https://discourse.vtk.org/t/update-point-in-real-time/1129 "2019-06-13T21:18:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![osamax](https://discourse.vtk.org/user_avatar/discourse.vtk.org/osamax/32/523_2.png) [@osamax](https://discourse.vtk.org/u/osamax)
#### Post date: [June 13, 2019, 9:18pm UTC](https://discourse.vtk.org/t/update-point-in-real-time/1129/1 "2019-06-13T21:18:59Z")

</div>

Hi everyone,

I’m very new to VTK. I’ve found it to be quite complicated but have been familiarizing myself by playing with the tutorial examples (in C++).

The task I’m working on is to have a single point that changes positions in real time. I have a simple VTK program that draws the initial point.

I have a separate C++ program that I wrote which continuously updates the position I want the point to move to (x and y coordinates). These values are obtained from a mouse sensor. I use an infinite while loop to continuously get the values I need.

From what I’ve been able to see, the only way I can update the position of the point after rendering is to use a callback function. I am using a timer callback so I can repeatedly enter the function to update the point position.

My issue is that I am not sure how to link the two programs. How can I initialize and render my point and at the same time also read coordinates from the mouse sensor?

I would appreciate any help and can gladly offer more details if required.

Thanks!
