Compiling slicer 4.10.x with slicer Virtual Reality

Operating system:win10 ,visual Studio 2015
Slicer version: 4.10.0 or 4.10.1
Expected behavior:
Actual behavior:

Hi, everyone. I am compiling slicer 4.10.x (using VTK 7) with slicer Virtual Reality source code and trying to get slicerVR work with the slicer 4.10.x . but i didn’t succeed and it always show the problem(see pic below) with vtkRenderingOpenVR .

Since the slicerVR installed from Extension manager can work perfectly with the slicer 4.10.x released(not source code compiled), so i wonder where i did wrong when compiling the source code .

I think this problem may come from the VTK version or the CMakeLists (in slicerVR source code).
Slicer 4.10.x can be compiled successfully with VTK 7 or 8, but i noticed some small differences when i do the cmake:


image

The slicer_VTK_RENDERING_BACKEND is different. OpenGL and OpenGL2.

When compiling slicerVR with slicer4.10.x(VTK 7), cmake can easily get through, but the problem shows in vs 2015(see the first pic).

However, when compiling slicerVR with slicer4.10.x(VTK 8), the problem shows in cmake, it cannot find the module : vtkRenderingOpenGL. While we can see from the above pics that VTK 8 connects to OpenGL2, which makes me really confused.

Anyone’s help would be appreciated.

To better address this type of question, I suggest you provide a .bat file with the configure and build commands allowing to reproduce the problem.

That said, here are the steps I recommend to move forward:

Step1: Virtual reality support was added in VTK8, for this reason I suggest you compile Slicer by simply padding Qt5_DIR variable, this will allow the build system to initialize everything else for you .

Step2 Once, you have a Slicer build tree, you should be able to build the SlicerOpenVR extension against it.

additional info

The 4.10.x series still support building against Qt4/VTK7/C++98 or Qt5/VTK8/C++11.

In the latest version available on Github, support for Qt4/VTK7/C++98 was removed.

Thanks for your quick response. I followed your advice and here are the results:

1 . Slicer4.10.0 + parent_hmd_transform
(GitHub - KitwareMedical/SlicerVirtualReality at parent_hmd_transform)
works perfectly !:+1::+1::+1:

  1. Slicer4.10.0 + SlicerVirtualReality
    (GitHub - KitwareMedical/SlicerVirtualReality: A Slicer extension that enables user to interact with a Slicer scene using virtual reality.)

problem shows in VS 2015 when compiling the SlicerVR

  1. Slicer4.10.1 + SlicerVirtualReality(no matter which slicerVR ‘s version)
    problem shows in cmake (see below pic):

For all above ways, i compiled slicer source code by using VTK 8.