You are not logged in.

1

Thursday, July 4th 2013, 10:28am

Mainloadpano question.

Hey guys.

Lately I wrote a code for my virtual tour to stop the autorotation when someone moves a mouse over the hotspot.
Had a bit of little problems there but I made a walkaround codes. Its huge because of huge amount of hotspots in the tour.

I would like to ask you if there is an easier way to get the maindloadpano(virtualtourXX) part, instead of going throu each xml file and checking it.

Here is the code:

Source code

1
set(hotspot[spot27].onclick,set(autorotate.enabled,true);looktohotspot(get(name),get(view.fovmin),smooth(400,20,100));mainloadpano(virtualtour11.xml);lookat(get(hview),get(vview),get(fovview));wait(blend);lookto(get(panoview.h),get(panoview.v),get(panoview.fov),smooth(100,20,50)));


I was wondering if there could be something done with "get".

Thanks in advance.

Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

2

Thursday, July 4th 2013, 11:07am

Without the rest of the code it's hard to say. I also didn't get your issue exactly.
What I can propose to you is to use style to define what you want with less coding.

E.g. On Hotspot define new attribute which will contain information what xml is to be loaded when clicked on hotspot. Than in style you can have something like this:

Source code

1
2
<hotspot name="your_hotspot_1" style="your_style" ath="5" atv="4" xml_to_load="virtualtour11" />
<style name="your_style" visible="true" keep="false" url="your_png_file.png"   onout="set(autorotate.enabled,false);" 	onover="set(autorotate.enabled,false);"	onclick="txtadd(load_xml,'%FIRSTXML%/get(xml_to_load),'.xml');loadpano(get(load_xml), null, MERGE, BLEND(3));"	/>


Did you get the point? Can this help you with the rest?

3

Thursday, July 4th 2013, 3:48pm

Dont rly understand the code on the 1st look at it :)

I'll study it a bit.

My point is to:

-When autorotation is turned on : stop autorotating when mousce cursor get over the hotspot and start it again when it get out of the hotspot.

-When the autorotation is turned off: do nothing :)

And ofc it has to remember that the autorotation was turned on/off when changing the pano via mainloadpano.

Dunno if you get my point now :D

Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

4

Thursday, July 4th 2013, 8:41pm

As you didn't share any code or link I will try to explain:
- Most probably you have button that turn autorotation on/off. There you have to set some variable e.g. autorotation_turned_on to true. Just to keep the state of autorotation.
So, find the code where you are turning autorotation on and add the following:

Source code

1
set(autorotation_turned_on, true);

Where you turning it off put:

Source code

1
set(autorotation_turned_on, false);

In your hotspot definition add:

Source code

1
onover="if(autorotation_turned_on,set(autorotate.enabled,false));"onout="if(autorotation_turned_on,set(autorotate.enabled,true));"

Justs tested and it is working fine.

5

Thursday, July 4th 2013, 9:02pm

My god :O Why didnt I think of "if" inside onover/onout.

You are a life saver !

Many thanks, you have no idea how happy did u make me :D

Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

6

Thursday, July 4th 2013, 9:05pm

That's why this forum is good, at least to tickle someone brain ;)
Enjoy.