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

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)

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.

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.