# 3D mouse cursor for stereoscopic displays

**URL:** https://discourse.slicer.org/t/3d-mouse-cursor-for-stereoscopic-displays/28370
**Category:** Development
**Created:** [March 14, 2023, 11:18am UTC](https://discourse.slicer.org/t/3d-mouse-cursor-for-stereoscopic-displays/28370 "2023-03-14T11:18:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![LucasGandel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lucasgandel/32/18202_2.png) [@LucasGandel](https://discourse.slicer.org/u/LucasGandel)
#### Post date: [March 14, 2023, 11:18am UTC](https://discourse.slicer.org/t/3d-mouse-cursor-for-stereoscopic-displays/28370/1 "2023-03-14T11:18:33Z")

</div>

Hello,

We would like have a 3D cursor in the 3D view, similar to the [new widget](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9894) that was recently merged in VTK.  
This widget replaces the mouse cursor by a 3D point representation that is projected on the surface when an actor is hovered.  
This feature is useful in a stereo environment, or when using haptic devices, to better visualize the position of the cursor in the 3D scene.

We noticed that the current crosshair implementation in 3DSlicer offers a similar functionality, but the following requirements are missing:

1. The 2D mouse cursor should be hidden and replaced by the crosshair
2. The crosshair position should be updated on mouse move events without pressing the shift key
3. The crosshair position should be updated smoothly using a hardware picker (as opposed to the current volume picker)

We are not sure what is the best path forward to make this functionality available in 3DSlicer.  
Should we update the current crosshair implementation to add a new mode that fulfills the requirements above?  
Or is it preferred to integrate the vtk3DCursorWidget directly?

Many thanks,  
Lucas

cc: @LaurennLam

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [March 14, 2023, 2:00pm UTC](https://discourse.slicer.org/t/3d-mouse-cursor-for-stereoscopic-displays/28370/2 "2023-03-14T14:00:12Z")

</div>

That sounds pretty close to the current crosshair behavior and I think you could just make these modes available without adding a whole new mechanism.

---

<div class="post-metadata">

### Author: ![LucasGandel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lucasgandel/32/18202_2.png) [@LucasGandel](https://discourse.slicer.org/u/LucasGandel)
#### Post date: [March 15, 2023, 8:02am UTC](https://discourse.slicer.org/t/3d-mouse-cursor-for-stereoscopic-displays/28370/3 "2023-03-15T08:02:58Z")

</div>

Thanks a lot for your insight @pieper ! Sounds good to me.

Let’s wait for potential feedback from @lassoan and @jcfr before we go any further.

---

<div class="post-metadata">

### Author: ![LaurennLam](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/laurennlam/32/16833_2.png) [@LaurennLam](https://discourse.slicer.org/u/LaurennLam)
#### Post date: [March 24, 2023, 10:20am UTC](https://discourse.slicer.org/t/3d-mouse-cursor-for-stereoscopic-displays/28370/4 "2023-03-24T10:20:58Z")

</div>

A PR has been opened to answer the requirements.  
It can be found [here](https://github.com/Slicer/Slicer/pull/6910)
