You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, September 26th 2019, 11:52am

Do NOT see a hotspot with vr glasses

I try not to see a hotspot when wearing vr glasses.
The code I have given is this:

Source code

1
<hotspot name = "z105" handcursor = "true" distorted = "true" url = "imag / lupa_plus.png" scale = "0.3" ath = "- 111.785" atv = "6.043" scale.mobilevr = "0" />

But the instruction scale.mobilevr = "0" does not work for me and the hotspot is still visible when I wear the glasses.
Any suggestions?

spacerywirtualne

Professional

Posts: 907

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Thursday, September 26th 2019, 12:12pm

Hi,

Static data is read-only. You must change visible="false" or scale="0" dynamically. Eg:

Source code

1
<events name="myevz105" keep="true" webvr_onentervr="set(hotspot[z105].scale, 0.0)" webvr_onexitvr="set(hotspot[z105].scale, 0.3)" />


Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

3

Sunday, September 29th 2019, 9:38am

It doesn't work for me *sad*
In http://www.imaginartejuegos.com/prueba_hotspot/ I have prepared a test.
Hotspot 1 has nothing special.
Hotspot 2 has the code:

Source code

1
<hotspot name = "z105" handcursor = "true" distorted = "true" url = "imag / lupa_plus2.png" scale = "0.6" style = "tooltip" tooltip = "scale.mobilevr" ath = "180" atv = "-10" scale.mobilevr = "0" />

Hotspot 3 has the code you indicate:

Source code

1
<hotspot name = "myevz272" handcursor = "true" distorted = "true" url = "imag / lupa_plus3.png" scale = "0.6" style = "tooltip" tooltip = "webvr_onentervr" ath = "190" atv = "- 10 "webvr_onentervr =" set (hotspot [z105] .scale, 0.0) "webvr_onexitvr =" set (hotspot [z105] .scale, 0.3) "/>

I am doing something wrong?
Regards

4

Wednesday, October 9th 2019, 7:33am

Partially solved

Thank you very much Spacerywirtualne.
In the link http://www.imaginartejuegos.com/prueba_hotspot/ I have already managed to understand what needs to be done to make it work.
The code would be:

Source code

1
<events name = "myevz44" keep = "true" webvr_onentervr = "set (hotspot [z44] .scale, 0.0)" webvr_onexitvr = "set (hotspot [z44] .scale, 0.3)" /><hotspot name = "z44" handcursor = "true" distorted = "true" url = "imag / lupa_plus1.png" scale = "0.6" style = "tooltip" tooltip = "Normal" ath = "160" atv = "- 10 "/>  <events name = "myevz105" keep = "true" webvr_onentervr = "set (hotspot [z105] .scale, 0.0)" webvr_onexitvr = "set (hotspot [z105] .scale, 0.3)" />    <hotspot name = "z105" handcursor = "true" distorted = "true" url = "imag / lupa_plus2.png" scale = "0.6" style = "tooltip" tooltip = "scale.mobilevr" ath = "180" atv = "-10" scale.mobilevr = "0" />

The problem is that I have more than 15 hotspot in each scene and more than 10 scenes. It is a bit tedious to put the events in each of the hotspot of all of them.
How could I have a single event for everyone and maybe an instruction to add to the hotspot to call the event, or something like that?

5

Wednesday, October 9th 2019, 8:45am

Other inconvenience

Even putting the events in one scene, moving to the other does not work anymore.
If he gets out of the glasses and re-enters, then it does work in the second scene.

6

Wednesday, October 9th 2019, 9:49am

it does not make sense to have one event for each of your hotspots
and events with keep=true are global, you better don't define those in scenes

but, here is a better solution for you

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<events name="webvr_hotspot_hide" keep="true" 
	webvr_onentervr="webvr_hotspot_hide(true);" 
	webvr_onexitvr="webvr_hotspot_hide(false);" 
	/>

<action name="webvr_hotspot_hide" scope="local" args="hide">
	for(set(local.i,0), i LT hotspot.count, inc(i),
		if(hotspot[get(i)].webvr_hide,
			if(hide,
				copy(hotspot[get(i)].visible_bak, hotspot[get(i)].visible);
				set(hotspot[get(i)].visible, false);
				trace(hotspot[get(i)].name,' is now hidden');
			, hotspot[get(i)].visible_bak !== null,
				copy(hotspot[get(i)].visible, hotspot[get(i)].visible_bak);
				delete(hotspot[get(i)].visible_bak);
				trace(hotspot[get(i)].name,' is now visible');
			);
		);
	);
</action>

<scene name="..." >
	<hotspot name="z105" webvr_hide="true" ... />
</scene>


the event and action are global and to be defined OUTSIDE of the scenes
together they will handle visibility on all hotspots having this marker: webvr_hide="true"

This post has been edited 1 times, last edit by "indexofrefraction" (Oct 9th 2019, 10:27am)


7

Thursday, October 10th 2019, 11:01am

A small problem to finish off.

Thank you Indexofrefraction ;-)
It is perfect, although it has a small problem when there is more than one scene, which I have not been able to solve:
In the example http://www.imaginartejuegos.com/prueba_hotspot/ I added one more scene (there are now 2). When passing from one to another, from inside the VR glasses, the hotspots are not kept hidden.
If I leave the VR glasses and re-enter, in any of the scenes, the hotspot of that scene disappears, but not those of the others.
In fact, when I return to the first scene, from inside the VR glasses, the missing buttons reappear.

8

Thursday, October 10th 2019, 12:42pm

ok, this is because a new scene does not trigger the events ...

let's do it differently...
we dont need onenter/exitvr, we can use onnewscene,
because enter/exit vr always reloads the scene.
in webvr_hotspot_hide() we check webvr isenabled and hide or show.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<events name="webvr_hotspot_hide" keep="true" 
	webvr_onnewscene="webvr_hotspot_hide();" />

<action name="webvr_hotspot_hide" scope="local">
	for(set(local.i,0), i LT hotspot.count, inc(i),
		if(hotspot[get(i)].webvr_hide,
			if(plugin[webvr].isenabled,
				copy(hotspot[get(i)].visible_bak, hotspot[get(i)].visible);
				set(hotspot[get(i)].visible, false);
				trace(hotspot[get(i)].name,' is now hidden');
			, hotspot[get(i)].visible_bak !== null,
				copy(hotspot[get(i)].visible, hotspot[get(i)].visible_bak);
				delete(hotspot[get(i)].visible_bak);
				trace(hotspot[get(i)].name,' is now visible');
			);
		);
	);
</action>

<scene name="..." >
	<hotspot name="z105" webvr_hide="true" ... />
</scene>

9

Thursday, October 10th 2019, 1:55pm

It still does not work

I have uploaded the new code and now it doesn't work even when you enter vr glasses.
You can see it in the same link.
Gracias.

Alexey Tkachenko

Professional

Posts: 757

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

10

Thursday, October 10th 2019, 2:17pm

Hi)

You use normal panoramas and in your case there's no scene reload when going to VR mode. (as far as I can see). Try the same code but with multiresolution panoramas from VR-optimised make Vtour droplet (MAKE VTOUR (VR-OPT) droplet.bat).
Regards,

Alexey

11

Thursday, October 10th 2019, 6:38pm

Hi. I have done the test, doing everything again from the beginning with the optimized droplet vtour, and the problem persists.

12

Thursday, October 10th 2019, 7:28pm

ups...

<events name="webvr_hotspot_hide" keep="true" onnewscene="webvr_hotspot_hide();" />

my bad ! *whistling*

13

Thursday, October 10th 2019, 7:50pm

It doesn't work for me ;-(

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<events name="webvr_hotspot_hide" keep="true" 
	webvr_onentervr="webvr_hotspot_hide(true);" 
	webvr_onexitvr="webvr_hotspot_hide(false);" 
 onnewscene="webvr_hotspot_hide();" 
	/>


<action name="webvr_hotspot_hide" scope="local" args="hide">
	for(set(local.i,0), i LT hotspot.count, inc(i),
 if(hotspot[get(i)].webvr_hide,
 if(hide,
 copy(hotspot[get(i)].visible_bak, hotspot[get(i)].visible);
 set(hotspot[get(i)].visible, false);
 trace(hotspot[get(i)].name,' is now hidden');
 , hotspot[get(i)].visible_bak !== null,
 copy(hotspot[get(i)].visible, hotspot[get(i)].visible_bak);
 delete(hotspot[get(i)].visible_bak);
 trace(hotspot[get(i)].name,' is now visible');
 );
 );
	);
</action>

14

Thursday, October 10th 2019, 9:01pm

you're taking the wrong code,
take the 2nd example, with the correction

like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<events name="webvr_hotspot_hide" keep="true" 
	onnewscene="webvr_hotspot_hide();" />

<action name="webvr_hotspot_hide" scope="local">
	for(set(local.i,0), i LT hotspot.count, inc(i),
		if(hotspot[get(i)].webvr_hide,
			if(plugin[webvr].isenabled,
				copy(hotspot[get(i)].visible_bak, hotspot[get(i)].visible);
				set(hotspot[get(i)].visible, false);
				trace(hotspot[get(i)].name,' is now hidden');
			, hotspot[get(i)].visible_bak !== null,
				copy(hotspot[get(i)].visible, hotspot[get(i)].visible_bak);
				delete(hotspot[get(i)].visible_bak);
				trace(hotspot[get(i)].name,' is now visible');
			);
		);
	);
</action>

<scene name="..." >
	<hotspot name="z105" webvr_hide="true" ... />
</scene>

15

Friday, October 11th 2019, 8:56am

Solved

Yeeeees!!!
Solved!!!
It is perfect!!!
*thumbsup*

Thank you
Regards

17

Friday, October 11th 2019, 2:31pm

Unexpected error.

Here we say: "Mi gozo en un pozo" (my joy in a well), because the solution, which seemed to work well, does strange things that I don't know how to solve and that can be appreciated by entering the link .

1. The scene in which you press for vr glasses does not eliminate the hotspot. When you move on to the next scene they do disappear from the second. When you return to the previous one, the buttons that were seen before have disappeared. It is as if the scene change works, but not access to vr glasses.
2. When you leave the VR glasses, the buttons do not recover.
HELP *cry*

18

Friday, October 11th 2019, 6:02pm

you didnt port the MAKE VTOUR (VR-OPT) scene settings.

all scenes must have
- havevrimage="true"
- an <image> with if="!webvr.isenabled" --> for non-vr
- an <image> with if="webvr.isenabled" --> for vr

drop one image on both droplets and compare the difference in the <scene> definition
then port these to your tour (and add the new image files)

what happens is, if you change from/to vr and scene[xyz].havevrimage is true
the scene gets reloaded. for non-vr the full multires is loaded, for vr a smaller single file pano is loaded
so the onnewscene event is always triggered on change and the hotspots get set.

hope you get this done... *huh*