<div dir="ltr"><div><br></div>First off the HTC Vive is awesome. It gives a glimpse at what can be done and it is a game changer. The ability to go into VR and look at, and interact with a dataset, model, or point cloud is incredibly satisfying and I suspect productive. In the next few years I believe it will continue to improve because it is just that compelling.  Better VR hardware and a lot more rendering performance is only going to make it more compelling.<div><br></div><div>So if you have a Vive or other OpenVR compatible device you should be able to use it with VTK now. I have created a vtkOpenVR remote module that includes drop in replacements for the core rendering and interaction classes. It is alpha code and has only been tested with the Vive but it seems to work. I have attached the <a href="http://www.vtk.org/Wiki/VTK/Remote_Modules">VTK Remote Module</a> file to this email.  It requires master git VTK. Note in VR basically you are always doing an interactive render and you have to maintain really fast interaction rates, as an example just using the cell picker for the dragon.ply model was causing interruptions. We will have to look more into asynchronous/threaded processing etc as we move forward. Below find the current README.md for the module. Feel free to improve/fix/question/etc.</div><div><br></div><div>Enjoy!</div><div>Ken</div><div><br></div><div><br></div><div><br></div><div><p style="margin:0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">** BETA/ALPHA code here, feel free to use and improve **</p><h2 style="font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.1;color:rgb(49,50,54);margin:24px 0px 12px;font-size:1.2em"><a id="compiling" class="" href="https://gitlab.kitware.com/ken-martin/vtkVive#compiling" style="color:rgb(48,132,187);text-decoration:none;margin-top:0px;height:0px;background-color:transparent"></a>Compiling</h2><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">This module is part of <a href="https://gitlab.kitware.com/ken-martin/vtkVive/blob/master/vtk.org" style="color:rgb(48,132,187);text-decoration:none;margin-top:0px;background-color:transparent">VTK</a> and relies on two external libraries. You will need to download/compile/install <a href="https://wiki.libsdl.org/Installation" rel="nofollow noreferrer" style="color:rgb(48,132,187);text-decoration:none;background-color:transparent">SDL2</a> as well as <a href="https://github.com/ValveSoftware/openvr" rel="nofollow noreferrer" style="color:rgb(48,132,187);text-decoration:none;background-color:transparent">OpenVR</a>. The CMake build process for this module will try to find those two libraries. Build an optimized version as you will need the performance.</p><h2 style="font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.1;color:rgb(49,50,54);margin:24px 0px 12px;font-size:1.2em"><a id="what-is-included" class="" href="https://gitlab.kitware.com/ken-martin/vtkVive#what-is-included" style="color:rgb(48,132,187);text-decoration:none;margin-top:0px;height:0px;background-color:transparent"></a>What is included</h2><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">These classes are designed to be drop in replacements for VTK. As long as you link your executable to this module the object factory mechanism should replace the core rendering classes such as vtkRenderWindow with OpenVR specialized versions. The goal is for VTK programs to be able to use the OpenVR library with little to no changes.</p><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">vtkOpenVRRenderWIndow handles the bulk of interfacing to OpenVR. It supports one renderer currently. The renderer is assumed to cover the entire window which is what makes sense to VR. Overlay renderers can probably be made to work with this but consider how overlays will appear in a HMD if they do not track the viewpoint etc. This class is based on sample code from the OpenVR project so it may not be completely ideal for VTK in its current form.</p><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">The vtkOpenVRCamera gets the matrices from OpenVR to use for rendering. It contains a scale and translation that are designed to map world coordinates into the HMD space (meters around 0,0,0 I believe) This way world coordinates can be kept in the units that makes sense for your problem domain and the camera will handle shifting and scaling those coordinates into the units that make sens for the HMD.</p><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">vtkOpenVRRenderer that exists to make ResetCamera do something reasonable. In this case it computes a reasonable scale and translation and sets that on the OpenVRCmaera. It also sets the default clipping range expansion to be more reasonable as the VTK default is way too generous.</p><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">Supporting interaction is a little odd. All of VTK is designed to pick and interact based on X,Y mouse window coordinates. With OpenVR we actually have XYZ world coordinates and WXYZ orientations. The vtkOpenVRRenderWindowInteractor catches controller events and converts them to mouse window events (yuck) but it also stores the world coordinate positions and orientations for styles/pickers that can use them (yay). It supports multiple controller through the standard PointerIndex approach used already by VTK for multitouch.</p><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">To work with the vtkOpenVRRenderWindowInteractor we have a vtkInteractorStyleOpenVR that uses world coordinate XYZ position, WXYZ orientation to adjust actors. This provides a nice grab and move style of interaction that is common to OpenVR.</p><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">To determine what prop has been picked we have a vtkOpenVRPropPicker that uses the XYZ world coordinate as the picking value as opposed to intersecting a ray which is slower etc.</p><h2 style="font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.1;color:rgb(49,50,54);margin:24px 0px 12px;font-size:1.2em"><a id="todo" class="" href="https://gitlab.kitware.com/ken-martin/vtkVive#todo" style="color:rgb(48,132,187);text-decoration:none;margin-top:0px;height:0px;background-color:transparent"></a>TODO</h2><p style="margin:6px 0px 0px;color:rgb(92,93,94);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px">there are a few areas that are ripe for improvement.</p><ul style="padding:0px;color:rgb(85,85,85);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21.4286px;margin:6px 0px 6px 28px!important"><li style="line-height:1.6em;margin-top:0px"><p style="margin:0px;color:rgb(92,93,94)">Add support for the OpenVR overlay, it is a great way to display a user interface and OpenVR has a lot of support built in for it.</p></li><li style="line-height:1.6em"><p style="margin:0px;color:rgb(92,93,94)">Think seriously about picking and interactors/widgets in the context of having a XYZ position at the beginning of the pick operation.</p></li><li style="line-height:1.6em"><p style="margin:0px;color:rgb(92,93,94)">Performance, make it faster, make sure we are doing it the best way</p></li><li style="line-height:1.6em"><p style="margin:0px;color:rgb(92,93,94)">Performance, make sure long operations happen asynchronously</p></li><li style="line-height:1.6em"><p style="margin:0px;color:rgb(92,93,94)">Add more event interactions</p></li></ul><div><font color="#5c5d5e" face="Source Sans Pro, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:24px"><br></span></font></div><div><font color="#5c5d5e" face="Source Sans Pro, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:24px"><br></span></font></div><div><br></div>-- <br><div class="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div></div>