# Set location to start scene with VR plugin. Text not working in VR pluging

**URL:** <https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732>\
**Category:** Support\
**Tags:** virtual-reality\
**Created:** [March 24, 2021, 1:26am UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732 "2021-03-24T01:26:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [March 24, 2021, 1:26am UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/1 "2021-03-24T01:26:03Z")

</div>

Hello,

Firstly, I’m wondering if it is possible to set a starting location for the VR camera. I was hoping for something akin to unity’s camera object, where you can move it in the window. It then always starts from that location. If it were possible to move around with the headset, then it saves that location, that would work.

Second, text seems to not work in world space. The annotations seem to all appear clumped on the screen.

Any help would be appreciated 🙂, Thanks!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 24, 2021, 1:32pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/2 "2021-03-24T13:32:00Z")

</div>

> set a starting location for the VR camera

This function sets the VR view to match that of an existing 3D view in Slicer:

> <https://github.com/KitwareMedical/SlicerVirtualReality/blob/master/VirtualReality/Widgets/qMRMLVirtualRealityView.cxx#L743>

> [@smallvalthoss](#):
>
> text seems to not work in world space

2D actors cannot be displayed well in stereoscopic vision. You need to use 3D text.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 24, 2021, 3:10pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/3 "2021-03-24T15:10:34Z")

</div>

> [@cpinter](#):
>
> > [@smallvalthoss](#):
> >
> > text seems to not work in world space
> 
> 2D actors cannot be displayed well in stereoscopic vision. You need to use 3D text.

@smallvalthoss it would be great if you could explore this further, maybe with getting advice from the [VTK forum](https://discourse.vtk.org/). It may be possible to render all the 2D actors at some fixed plane at a convenient reading distance. If needed, we could replace all 2D actors by 3D counterparts at application level, but it would add a lot of complexity.

---

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [March 26, 2021, 5:26pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/4 "2021-03-26T17:26:38Z")

</div>

Thank you for the reply! I’m new to 3D slicer as well as creating/modifying extensions, so I appreciate the patience.

Do you know of a way to have it as a 3D object in the scene? So I could position it to start at the same spot every time?

I noticed in the code it sets the magnification to the default of 10x. Would I go in to the code and change that hard-coded bit (line 792) to get the value from the scene window?

---

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [March 26, 2021, 6:14pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/5 "2021-03-26T18:14:42Z")

</div>

@lassoan I will take a look! Thanks 🙂

---

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [April 16, 2021, 11:25pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/6 "2021-04-16T23:25:22Z")

</div>

Where in slicer is it possible to create 3D text?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 18, 2021, 7:28pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/7 "2021-04-18T19:28:27Z")

</div>

There are many ways to add 3D text, at various levels. The simplest solution is probably to create a custom markups type, where you change the 3D representation of point labels to use a 3D text actor (any of the classes that you see [here](https://vtk.org/doc/nightly/html/classvtkProp3D.html), for example vtkTextActor3D or vtkFlagpoleLabel). You can find a complete example of a custom markups node+widget+representation [here](https://github.com/Slicer/Slicer/tree/master/Utilities/Templates/Modules/LoadableCustomMarkups).

---

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [April 22, 2021, 8:53pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/8 "2021-04-22T20:53:24Z")

</div>

Thank you Andras, I will play around with this

---

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [April 22, 2021, 8:53pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/9 "2021-04-22T20:53:58Z")

</div>

I asked twice on the forum and no one has responded. But still thinking about it

---

<div class="post-metadata">

**Author:** ![smallvalthoss](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smallvalthoss](https://discourse.slicer.org/u/smallvalthoss)\
**Post date:** [April 22, 2021, 8:55pm UTC](https://discourse.slicer.org/t/set-location-to-start-scene-with-vr-plugin-text-not-working-in-vr-pluging/16732/10 "2021-04-22T20:55:23Z")

</div>

> [@cpinter](#):
>
> > set a starting location for the VR camera
> 
> This function sets the VR view to match that of an existing 3D view in Slicer:

This function does set the same location, but the magnification is always set to 10x. Is there a way of making it the same magnification? Also, wondering about saving the start location when you save the mrml scene node?
