You are not logged in.

1

Monday, July 8th 2019, 11:21am

Change logo size in VR mode

Hi guys
I added a logo to my tour, and it looks great in desktop (normal mode)
However, if I go into WebVR mode (or use VR mode from a mobile device), then the logo is over the left eye, and pretty HUGE!

If I change the scale tag, then it scales everywhere, not just in normal mode. How can I keep it as is in normal mode, but make it smaller in VR mode?

2

Thursday, July 11th 2019, 9:41am

Hi,

how is your logo defined?

But for setting other settings in VR you could use the onentervr/onexitvr events:
https://krpano.com/plugins/webvr/#onentervr

e.g.

Source code

1
2
3
4
<events name="mylogosize" keep="true"
        webvr_onentervr="set(hotspot[mylogo].scale,0.1);"
        webvr_onexitvr="set(hotspot[mylogo].scale,1.0);"
        />



Best regards,
Klaus

3

Thursday, July 11th 2019, 10:42am

Hi Klaus
In the tour.xml I added a line:

Source code

1
<layer name="skin_logo" url="logos/mainlogo.png" scale="0.5" keep="true" vr="true" enabled="false" align="lefttop" x="10" y="10"/>	

Would that mean, your code is in the vtourskin.xml file and I need to modify the variables according to my "skin_logo", I would end up with:

Source code

1
2
3
4
<events name="skin_logo" keep="true"
        webvr_onentervr="set skin_logo.scale,0.1);"
        webvr_onexitvr="set skin_logo.scale,1.0);"
        />
Is that correct?

4

Thursday, July 11th 2019, 11:24am

About your code - that would be the correct syntax:

Source code

1
2
webvr_onentervr="set(layer[skin_logo].scale,0.1);"
webvr_onexitvr="set(layer[skin_logo].scale,1.0);"


But normally layers are getting hidden when in VR mode.
Your's is only keeping showing-up because of the vr="true" setting you have added.

But note - in 'real' WebVR (not the Cardboard fallback) all layers are always hidden when being in VR mode.
That's because there only WebGL content is possible and layers are HTML, not WebGL.

That means if you really want to show a logo in VR, doing this as hotspots would be the better solution.

Best regards,
Klaus