Colored Poygone Hotspots by movement

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
CWabner
Posts: 13
Joined: Mon May 24, 2021 12:16 pm

Hi together, i use the "panoramaMoving" Variable to show Polygon Hotspots in different colours. The Timer, shows depending on the Hotspot ID a different colour, only when the panorama is moving - so far so fine. But even the Timer stands on 0,001 sec. it´s not really a "smooth" change, has anyone an idea to let it change more smoothly?

And a second question :D - if i load the panorama, the colours "flickers" for a second (even if the variable is on startup on false) - i don´t find a reason for it???

Thanks or some ideas...

( https://alpenguides.de/test/ ) - for Test
Claudio
Attachments
screen.jpg
screen.jpg (570.52 KiB) Viewed 1381 times
CWabner
Posts: 13
Joined: Mon May 24, 2021 12:16 pm

Nobody any ideas??
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
To help it would be better to see the project and how you have put it together.
The best thing to do is send your support package with all files selected to support@ggnome.com with reference to this forum post.
We can then have a look at how the project has been put together.
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Claudio,
Thank you for sending your files, it makes it much easier for us to see what you are doing and how the issues can be fixed.

We changed a couple of things, firstly you were using timers to trigger the polygon colour change.
We removed this timer and added a container with the ID: Show Hide Polygons

This uses the trigger, Variable Changed (1).
Please see the screenshot from one of the actions:

1.png
1.png (209.8 KiB) Viewed 1287 times

What this does is detect when the variable changes and uses this to trigger an action.


We also changed the javascript code block and trigger to call it.
The Trigger has been changed to Config Loaded, so changed from Start.
This is because Start is more about the skin, but the polygons are added with the XML file to the panoramas, so using Config Loaded is the better trigger.

The javascript has been changed.

Code: Select all

javascript:
var lastPan = -1.0;
var lastTilt = -1.0;
setInterval(function() {
   var curPan = player.getPan();
   var curTilt = player.getTilt();
   player.setVariableValue('panoramaMoving', (curPan != lastPan || curTilt != lastTilt) && lastPan != -1);
   lastPan = curPan;
   lastTilt = curTilt;
}, 200);
Note: the changes were var lastPan and lastTilt now starts with -1.0.
Then, && lastPan != -1 so what this does is say the last pan has to be more than -1 which it will as soon as you rotate the panorama.
This stops the flicker on the project open.

What this does is cause the polygons will stay at their default colours, blue.
So under the HTML5 output and Hotspots tab, change the default colour to white.

2.png
2.png (21.84 KiB) Viewed 1287 times


Also, the attached skin has two containers, one for the panorama movement and one for the actions, of course, you can add the actions to the panorama movement, so reducing the skin down to one container.

For others following the skin uses specific Polygon IDs to Claudio project, to use the skin you would need to change the Polygon IDs in the actions found in the container Show Hide Polygons.
Regards,
Attachments
support_poly-extimage-ext.ggsk
(1.22 KiB) Downloaded 117 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
CWabner
Posts: 13
Joined: Mon May 24, 2021 12:16 pm

Hi Martin, thanks a lot, much smarter than my way :D it´s surprising how many way´s are possible with pano2vr.

I think it´s a pretty nice way to show visitor of a 360° Tour the way to walk through the tour, like for example museum do :wink:

thx again, Claudio
Post Reply