Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Donnerstag, 4. März 2010, 23:11

Disabling autorotate after user interaction

Hi there

I'm creating a virtual tour, and I would like the camera to start rotating right after the panoramic photo loads, but not to rotate after the user moves it.
I tried executing the following action at onstart:



<action name="init">
set(autorotate.waittime,0);
set(autorotate.enabled,true);
delayedcall(1,set(autorotate.waittime,-1))
</action>

But unfortunately it didn't work, as 1s after start the camera stopped rotating, even without any user interaction. Is there some way to work around this? I'm thinking of adding an invisible plugin and capturing the onclick action, but it's not very elegant and probably won't work if the keyboard is used for control.

Thanks
Manuel
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

Mael B.

Schüler

Beiträge: 157

Wohnort: France, Montpellier

  • Nachricht senden

2

Donnerstag, 4. März 2010, 23:24

the user need to click on the pano to move it... so use the 'onclick event' *smile*

Quellcode

1
2
3
4
5
<events onclick="action(clicked);" />

<action name="clicked">
 	set(autorotate.enabled,false);
	</action>

3

Donnerstag, 4. März 2010, 23:24

dont set auto rotate with an action. just use the code provided inside the xml editor. then use the

oninterupt="set(autorotate.false)" - spelling may be wrong but you get the idea.

4

Donnerstag, 4. März 2010, 23:46

Thanks a lot for such quick responses :)

The onclick worked! But I couldn't find that event in this part of the docs: http://krpano.com/docu/xml/#events . Is there some other place where I can get a list of all the available events?

Sorry, I didn't understand the "oninterrupt" suggestion. I tried creating an <event oninterrupt ... /> with <autorotate/> defined as normal, which didn't disable the autorotate; and I also tried this:

<krpano version="1.0.8" onstart="oninterrupt(set(autorotate.enabled,false)),set(autorotate.waittime,0);set(autorotate.enabled,true);">


In this case the camera didn't start rotating. Did I mess something up, or were you suggesting something else?
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

5

Donnerstag, 4. März 2010, 23:47

Oops, I meant this:
<krpano version="1.0.8" onstart="oninterrupt(set(autorotate.enabled,false));set(autorotate.waittime,0);set(autorotate.enabled,true);">
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

6

Freitag, 5. März 2010, 02:16

the below code should work. however after a quick test it did not. i dont have time to test more tonight. maybe an issue with 1.0.8 beta 9, try an older version i searched the forums and this seems to be the correct code.

<events oninterrupt="set(autorotate.enabled,false);>

<autorotate enabled ="true"
waittime="1.5"
accel ="1"
speed ="10"
horizon ="0"
tofov ="NaN"
/>

Mael B.

Schüler

Beiträge: 157

Wohnort: France, Montpellier

  • Nachricht senden

7

Freitag, 5. März 2010, 10:51

the docs about 'onclick event' is here : krpano 1.0.8 beta 7 (new features of the beta7)

rdhoore108

Schüler

Beiträge: 89

Wohnort: Belgium

Beruf: Systems and Network Administrator

  • Nachricht senden

8

Samstag, 18. September 2010, 20:10

In case anyone still needs this, I did like this:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<krpano autorotate_big_delay="20">

	<events onmousedown="mouse_down()" onmouseup="mouse_up()" />

	<autorotate enabled="true"
		waittime="6.0"
		accel="1.0"
		speed="7"
        />

	<action name="mouse_down">
		copy(mx, mouse.x);
		copy(my, mouse.y);
	</action>

	<action name="mouse_up">
		sub(v, mouse.x, mx);
		if (v LT 0, mul(v, -1));
		if (v GT 20, 
			set(mouse_moved, true);
		,
			sub(v, mouse.y, my);
			if (v LT 0, mul(v, -1));
			if (v GT 20, 
				set(mouse_moved, true);
			,
				set(mouse_moved, false);
			);
		);
		if (mouse_moved,
			copy(ar, autorotate.enabled);
			set(autorotate.enabled, false);
			copy(autorotate.waittime, autorotate_big_delay);
			copy(autorotate.enabled, ar);
		);
	</action>


Using this, the panorama will start to auto-rotate after 6 seconds, but when the user drags it herself, it will only auto-rotate again after 20 sec.
- Ronny D'Hoore

9

Donnerstag, 16. Juni 2011, 19:25

that doesnt work for me - but iam still searching for something like this.-



autrotate till user interact - than wait and set up for autorotate-
so if user pressed video or slidshows the autorotation will stop

but after a period of non inteactivity the autrotation will start ???

does anybody know?

HansNyb

Profi

Beiträge: 1 063

Wohnort: Denmark

Beruf: Photographer

  • Nachricht senden

10

Donnerstag, 16. Juni 2011, 21:57

Here is a much simpler code. Of course you do not need to set different settings for autorotate for different devices.
This is just a demo that you can do that also, Especially speed settings needs to be different.


<events onmousedown="set(autorotate.enabled,true);set(autorotate.waittime, 15);" />

<autorotate devices="desktop" enabled="true"
waittime="3.0"
accel="1.5"
speed="4"
horizon="0"
tofov="110"

/>

<autorotate devices="mobile" enabled="true"
waittime="1.0"
accel="1.5"
speed="16"
horizon="0"
tofov="120"

/>

<autorotate devices="tablet" enabled="true"
waittime="1.0"
accel="1.5"
speed="7"
horizon="0"
tofov="110"

/>


Hans