# 3dConnexion (TDx) support in VTK on Windows?

**URL:** https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645
**Category:** Support
**Created:** [August 23, 2019, 11:00pm UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645 "2019-08-23T23:00:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![geoffw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@geoffw](https://discourse.vtk.org/u/geoffw)
#### Post date: [August 23, 2019, 11:00pm UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645/1 "2019-08-23T23:00:32Z")

</div>

Hi,

We are very interested in using 3DConnexion’s 3d mice in our software. I was excited to find that it was supported in vtk. However, looking at the build files, it seems perhaps it is not supported on windows. Setting VTK\_USE\_TDX at the cmake level does not result in the corresponding compiler flag getting set.

vtkTDxConfigure.h ends up looking like this (note the last line):

/\*=========================================================================

Program: Visualization Toolkit  
Module: vtkTDxConfigure.h.in

Copyright © Ken Martin, Will Schroeder, Bill Lorensen  
All rights reserved.  
See Copyright.txt or [http://www.kitware.com/Copyright.htm](http://www.kitware.com/Copyright.htm) for details.

```
 This software is distributed WITHOUT ANY WARRANTY; without even
 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE. See the above copyright notice for more information.

```

=========================================================================\*/

/\* The TDx support has not been ported, this header defines nothing. \*/

We are using OpenGL2. We see the following in CmakeLists.txt for Rendering/OpenGL2:

# The TDx support has not been moved, this header is here to define nothing,

# and so allow classes in other modules to safely include it and keep going.

configure\_file(${CMAKE\_CURRENT\_SOURCE\_DIR}/vtkTDxConfigure.h.in

${CMAKE\_CURRENT\_BINARY\_DIR}/vtkTDxConfigure.h)

as opposed to the file in Rendering/OpenGL, which presumably defines a value:

# FIXME: The TDx support needs some refactoring before we can build it in a

# modular fashion, for now it must remain an option on vtkRenderingOpenGL.

option(VTK\_USE\_TDX “Use TDx interaction devices” OFF)

mark\_as\_advanced(VTK\_USE\_TDX)

if (TDX\_INCLUDE\_DIR)

include\_directories(${TDX\_INCLUDE\_DIR})

endif()

configure\_file(${CMAKE\_CURRENT\_SOURCE\_DIR}/vtkTDxConfigure.h.in

${CMAKE\_CURRENT\_BINARY\_DIR}/vtkTDxConfigure.h)

This page implies that it is supported:  
[https://vtk.org/Wiki/VTK/3DConnexion\_Devices\_Support](https://vtk.org/Wiki/VTK/3DConnexion_Devices_Support)

Can anyone shed some light on this?

thanks-

Geoff

---

<div class="post-metadata">

### Author: ![geoffw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@geoffw](https://discourse.vtk.org/u/geoffw)
#### Post date: [August 27, 2019, 11:29pm UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645/2 "2019-08-27T23:29:17Z")

</div>

Hi, if anyone cares to know: there is an old merge request for this feature: [https://gitlab.kitware.com/vtk/vtk/merge\_requests/2830/diffs#dbdfcf8839c6387381ba28f154f93c013e4daf13](https://gitlab.kitware.com/vtk/vtk/merge_requests/2830/diffs#dbdfcf8839c6387381ba28f154f93c013e4daf13)

I applied the diff, with some minor changes, to vtk8.1 and was able to get the mouse interaction basically working.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 28, 2019, 6:39am UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645/3 "2019-08-28T06:39:35Z")

</div>

Great, feel free to take over the MR and open a new one so it gets integrated into VTK.

---

<div class="post-metadata">

### Author: ![geoffw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@geoffw](https://discourse.vtk.org/u/geoffw)
#### Post date: [August 28, 2019, 3:11pm UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645/4 "2019-08-28T15:11:50Z")

</div>

That would be fun. I will see what I can do. But wouldn’t it be better to wait and do it in 8.2? (We are having trouble upgrading to 8.2 due to Qt issues, which I outlined in another post…)

The default behavior of the TDxCameraInteractor seems odd and not at all like how the mouse works in, for example, solidworks. I am going to have a stab at that as well…

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 29, 2019, 1:09am UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645/5 "2019-08-29T01:09:05Z")

</div>

Well, you should port the change to master.

---

<div class="post-metadata">

### Author: ![geoffw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@geoffw](https://discourse.vtk.org/u/geoffw)
#### Post date: [October 4, 2020, 2:37am UTC](https://discourse.vtk.org/t/3dconnexion-tdx-support-in-vtk-on-windows/1645/6 "2020-10-04T02:37:30Z")

</div>

If any one is interested, I am working on an MR for this feature…

[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/7262#diff-content-353c5d1a687d427a3692993df6848a65dce51dae](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7262#diff-content-353c5d1a687d427a3692993df6848a65dce51dae)
