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, 13. März 2014, 15:18

Timer, Autotour

Hi!
one more code for extend krpano functionality, you can start any count of timers.

The "Timer" :)

usage:
include timer.xml to your tour
start timer - timer.start(name,delay,actions);
Where
name - is the custom timer name any you want, "mytimer" for example.
delay - timer period delay in seconds
actions - any krpano actions,optional

when timer starts, event with same name will be available
for example
<events mytimer="actions"/>
you can use any count of event call using named events and keep = true / false

for stop timer use timer.stop(name);
name - is the custom started timer name

timer_name.reset(); - reset delay of timer, for example if you need to restart timer period.
reset() will set enabled to true also.

you can change delay in runtime, simple set delay value
for example set(timer_name.delay,10); will change timer delay to 10 seconds

for pause executing timer use
set(timer_name.enabled,false); or timer_name.pause();
resume executing

set(timer_name.enabled,true); or timer_name.resume();

EXAMPLE:
timer.start(mytimer1,10,trace(10 seconds)); - will trace text "10 seconds" every 10 seconds.
same but using events

timer.start(mytimer1,10);
<events mytimer1="trace(10 seconds)"/>

Hope you like it *thumbup*
»Sudarchikov Andrey« hat folgende Dateien angehängt:
  • timer.xml (982 Byte - 38 mal heruntergeladen - zuletzt: 23. Oktober 2017, 13:40)
  • timer_autotour_example.zip (185,86 kB - 54 mal heruntergeladen - zuletzt: 6. November 2017, 12:20)
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »Sudarchikov Andrey« (14. März 2014, 18:32)


2

Donnerstag, 13. März 2014, 15:21

AUTOTOUR EXAMPLE: will switch scenes to next after 30 second if user not interact with tour interface and panorama and autorotate is enabled

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
<krpano onstart="loadscene(0);timer.start(autotour,30);"/>
<events name="autotour" keep="true"
	onxmlcomplete="autotour.reset();"
	onmousedown="autotour.pause();"
	onmouseup="autotour.reset();"
	autotour="
		if(autorotate.enabled,
			add(sceneindex,scene[get(xml.scene)].index,1);
			if(sceneindex == scene.count, set(sceneindex,0); );
			loadscene(get(sceneindex),null,merge,blend(0.7));
		);
	"/>



Have a nice day
Andrey *thumbup*
»Sudarchikov Andrey« hat folgende Datei angehängt:
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Sudarchikov Andrey« (14. März 2014, 18:48)


3

Samstag, 15. März 2014, 18:36

Perfect Soution...

This really helped me out Andrey - Thank you for sharing the code.

John

4

Samstag, 15. März 2014, 21:29

Hi!
thanks for feedback *rolleyes*
glad to know

Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

wilsan

Schüler

Beiträge: 65

Wohnort: Nederland

Beruf: Logistics Specialist – Planning & Logistics

  • Nachricht senden

5

Sonntag, 16. März 2014, 14:24

Hi Andrey,

Whow... very smooth example, thank you for sharing this great example. *thumbsup*
I'm looking sometime how to do this, but you're example... Thanks. *thumbsup*

Regards,
Wilsan

6

Montag, 17. März 2014, 09:35

Super. Works.

Now I am searching how to set "rotation time" specific for each scene and how to set specific initial view( hlookat , vlookat, fov) for each scene. *confused*

marty

7

Montag, 17. März 2014, 10:03

Hi!
you can change timer delay
for example
if you start timer
timer.start(autotour,30); - means you set 30 seconds delay
you can change it at any time, simple set(autotour.delay,NUMBER);
where NUMBER is delay in seconds. set(autotour.delay,50); change delay to 50 seconds, set(autotour.delay,0.1); change delay to 100 miliseconds,
timer continue works but with diff delay.


Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

8

Montag, 17. März 2014, 10:08

About specific vew and delay
use tag "view" in each scene for set start view and onstart for set delay
for example:

Quellcode

1
2
3
4
5
6
7
<scene name="s1 onstart="set(autotour.delay,60);">
	<view hlookat="100" vlookat="0"/>
</scene>

<scene name="s2" onstart="set(autotour.delay,50);">
	<view hlookat="50" vlookat="0"/>
</scene>



Regards
Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

9

Montag, 17. März 2014, 15:30

Andrey, thanks, clear.
I definatelly try it in my tour and let you know.
martin

10

Sonntag, 23. März 2014, 17:59

I am trying to implement autotour under the START/STOP button.

In your example I want to stop or just to pause tour for example in third scene onstart="autotour.pause();" but autotour keeps going.

How can I stop autotour and how to reset the timer to start autotour from scene one?

marty

11

Montag, 24. März 2014, 13:22

Hi!
autotour.pause() - must work.
can you send me your xml
i will check it, maybe something wrong.

Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

12

Montag, 24. März 2014, 18:28

Hi Andrey,

I just want to check the action and used autotour.pause(); in onstart of the third pano.
Just added to your xml this:
<scene name="scene3" onstart="copy(layer[text].html,scene[get(xml.scene)].name);autotour.pause();">
<view hlookat="0.0" vlookat="40.0" />

where I want to stop or pause autotour with the scene3 but autotour keeps going.

Is there action autotour.stop() ?

My idea is to add start and stop button to the buttons panel.
Autotour does not start when the rotation is OFF. I should first start rotation for starting autotour.


What I do not know exactly is, how to start autotour if you are in the middle of the tour - start all the time from the first pano or start autotour from the current pano.
That is a question.

13

Montag, 24. März 2014, 19:13

Hiwell, this part of code is reset timer all the time.
onxmlcomplete="autotour.reset();"
onmouseup="autotour.reset();"

you can call autotour.pause() with small delay
for example
delayedcall(0.1,autotour.pause(););
it will pause timer after 0.1 second
try it, hope it helps

But you can switch off autotour by set(aytorotate.enabled,false);
because of this
if(autorotate.enabled, blabla
You can add your own variable for condition of autotour work



Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

14

Montag, 24. März 2014, 22:12

yes
delayedcall
THX *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »martyhr« (24. März 2014, 22:24)


ramirox3

Schüler

Beiträge: 141

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

15

Dienstag, 25. März 2014, 01:16

Martyhr
we could see the end result
Ramiro

16

Sonntag, 26. Februar 2017, 23:09

Hi Andrey,

I was praising your code saying to myself "it's code with taste!" based on Linus TorvladsGood Taste. But when testing your timer I found some inconsistenses:
- the actions (arg %3) does not work;
- the next instance of the timer overwrites the first one e.g. in my test case:

Quellcode

1
2
3
<krpano debugmode="true" 
onstart="showlog(true);loadscene(0);timer.start(autotour,5);timer.start(mytimer, 2, trace(%0 %1 %2 %3, ' ACTIONs' ););" 
>

the dealy=5 of the autotour is changed from intital value after first reset to delay=2.

Since I wanted to use the enhanced timer for measuring of the elapsed time when loading scenes aparently I'm doing something wrong.
Or can you, please, give me an advice how to set a breakpoint in IE/Chrome/Firefox debugger from a krpano code without a need to step-in each line of code of the embedHTML5 function?

Thank you for inspiring ideas.
Pavel

ramirox3

Schüler

Beiträge: 141

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

17

Montag, 27. Februar 2017, 18:43

Hi Andrey
I am reproducing the example with a tour that contains 3 scenes. scene0, scene1, scene2. Everything works fine, but when it must go from scene2 to scene0, the scene actually changes, but the text stays in scene2 and when it should change to scene1, it stays in scene0 but marked scene2, and does not return To change scene. I am using the example codes without any change. My question is if I should make any changes to the code because the number of scenes is different

18

Freitag, 3. März 2017, 15:48

Hi!
sorry for such delay, better to contact me directly if you need fast answer :) too much busy these days

well as i can see i have made mistake :) it was a bug and direct callback was not working
so now code is fixed and works properly and it possible to use direct callback and event callback actions too
enjoy *thumbup*
you can download fixed version from first post, i did update, and let me know is all works fine now or not

Also, when you start timer it starts and each time calling event with same name

time.start(mytimer,10);

will fire event with name mytimer each 10 sec's

so you shold add event, like

<events name="blabla" keep="true"
mytimer="trace(My timer cabb back! each 10 sec's)"
/>

that's how it is working

Hope now all clear :)

Best wishes
Andrey

And yes, you are right callback actions which is defined in start method is not fire by some reasons, hm.... strange.. i will take a look, not can not promise it will be in nearest future
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Sudarchikov Andrey« (3. März 2017, 16:02)


19

Dienstag, 7. März 2017, 22:06

Hi Andrey,

I worked with your code and created an enhanced version of the timer. It works in the krpano ver. 1.19pr8 and has a new feature - it can log each action like start, pause, resume, reset, and stop. Both the timertick and elapsed time are shown in the showlog(true). The pause/resume is treated in the delayedcall, too.

The ramirox3 issue apears in the latest krpano versions becasue the loadscene(get(sceneindex)...) does not work after one round of scenes.
You need to use the scene.name instead:

Quellcode

1
loadscene(get(scene[get(sceneindex)].name),null,merge,blend(0.7));


Instead of Andrey's timer.start() I use the timer.init() action. I'm attaching the timer.xml and the example file too. Please let me know when any questions.

Thank you,
Pavel
»pur« hat folgende Dateien angehängt:

ramirox3

Schüler

Beiträge: 141

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

20

Mittwoch, 8. März 2017, 23:00

Pur, it works ok. Excellent
Ramiro