# Enable view synchronization in real-time between 3D View on Slicer and VR view on HTC vive

**URL:** <https://discourse.slicer.org/t/enable-view-synchronization-in-real-time-between-3d-view-on-slicer-and-vr-view-on-htc-vive/6718>\
**Category:** Support\
**Tags:** virtual-reality\
**Created:** [May 7, 2019, 1:37pm UTC](https://discourse.slicer.org/t/enable-view-synchronization-in-real-time-between-3d-view-on-slicer-and-vr-view-on-htc-vive/6718 "2019-05-07T13:37:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikecsu](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@mikecsu](https://discourse.slicer.org/u/mikecsu)\
**Post date:** [May 7, 2019, 1:37pm UTC](https://discourse.slicer.org/t/enable-view-synchronization-in-real-time-between-3d-view-on-slicer-and-vr-view-on-htc-vive/6718/1 "2019-05-07T13:37:50Z")

</div>

Operating system: win10  
Slicer version:4.11.0  
Expected behavior:To enable view synchronization in real-time between slicer and HTC vive  
Actual behavior:

Hi,I have been recently working on how to enable view synchronization in real-time between 3D View on Slicer and VR view on HTC vive. I noticed that i can synchronize the 3D view to VR view by clicking the button as i have shown in the below pic (red circle), and i think this button is really useful, but when it comes to real situation, we found that the patient is more likely to see the real-time change in VR view when the doctor operates the 3D view on Slicer(instead of clicking the button each time after doctors’ operation ) . Since i am new to develop 3D slicer and nowadays i am working on the source code, i hope someone can give me some advice for this development, any help would be appreciated.

 ![1557195000(1)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/f/5ffc87d4ed077404713cd41596702ed4dd03851c.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 7, 2019, 11:16pm UTC](https://discourse.slicer.org/t/enable-view-synchronization-in-real-time-between-3d-view-on-slicer-and-vr-view-on-htc-vive/6718/2 "2019-05-07T23:16:03Z")

</div>

You can add an observer to the camera node so whenever the camera is rotated a callback function is called, which updates the view in the VR headset.

However, probably it would work better if you used two computers and two headsets and synchronize them as shown [here](https://discourse.slicer.org/t/collaborative-surgery-planning-in-virtual-reality/6407/9).

---

<div class="post-metadata">

**Author:** ![mikecsu](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@mikecsu](https://discourse.slicer.org/u/mikecsu)\
**Post date:** [May 9, 2019, 7:59am UTC](https://discourse.slicer.org/t/enable-view-synchronization-in-real-time-between-3d-view-on-slicer-and-vr-view-on-htc-vive/6718/3 "2019-05-09T07:59:49Z")

</div>

Thanks a lot. By checking the source code of Slicer Virtual Reality module ,we found that we can achieve the function that we want by continuously calling the function—updateViewFromReferenceViewCamera() which already exists in VR source code.
