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.

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

1

Friday, August 10th 2012, 5:23pm

Math operators and animation: add + tween. UPD: stop delayedcall in action?

Math operators and animation: add + tween.
Hello!
Appeared task when you press the button or to define a action to make the move to a specific value hlookat/vlookat, for example on 10 horizontally and vertically in a spherical panorama.
Regular animation TWEEN will look this:

Source code

1
2
…
tween(view.hlookat,187.5,1.0); tween(view.vlookat,0.33,1.0);

But we have to write every time precisely value of hlookat/vlookat, but it is not convenient or suited for use one action in the different panoramas with different values of the starting point of view.
Is the operator ADD and you can use to them:

Source code

1
add(view.hlookat,5); add(view.vlookat,5);

There will be no movement on the transition, the values for hlookat / vlookat.
I tried different ways to merge these two operators, but could not in single action.
Tell me how to merge these two operators, or may need to use a different method and solution of the problem?
Panoreal — to make and see this wonderful world! *whistling*

This post has been edited 1 times, last edit by "Arsdezi" (Aug 12th 2012, 5:30pm)


2

Friday, August 10th 2012, 5:33pm

Hi,

do it that way - by using a temporary variable:

Source code

1
2
add(new_hlookat, view.hlookat, 5);
tween(view.hlookat, get(new_hlookat));


best regards,
Klaus

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

3

Friday, August 10th 2012, 11:05pm

Wow!
Thanks for quick your answer, Klaus!
*squint*
Panoreal — to make and see this wonderful world! *whistling*

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

4

Saturday, August 11th 2012, 5:27pm

stop delayedcall in action

It worked!
But there was another problem *sad*
I make the cursor movement with the rotation of the panorama tween+add (view.lookat) after a specified time(delayedcall)
Now when you click at any time (and time of execution of actions) on the "stop" button I need to hide the cursor and stop the movement of the panorama (stop the action performed by delayedcall), then hide the button itself, "Stop."
The cursor and the button are removed without errors, but that's to stop the action does not work!
I've tried different actions: breakall (), stopall, stop (action (xxxx)) - does not work *cry*
But try not to remove the button and when it sooo many times to press to "stop" — stop the actions.
PS: Used the latest and previous versions of krpano player(flash)

Quoted



<!-- button stop when onclick="action(stop); " /-->

<action name="stop">

tween(alpha, 0.0 ,0.5);
tween(plugin[round].alpha,0.0 ,0.5);
breakall ();
</action>




<action name="intro">
action(round-1); delayedcall(2.5, action(round-2););
</action>



<action name="round-1">

delayedcall(0.5,tween(plugin[round].y,50,1.5,easeoutquad);

delayedcall(0.5, add(new_hlookat, view.hlookat, -10); tween(view.hlookat, get(new_hlookat),0.5);

delayedcall(1.5, add(new_hlookat, view.hlookat, 10); tween(view.hlookat, get(new_hlookat),0.5);



</action>



<action name="round-2">


delayedcall(0.5,tween(plugin[round].y,-50,1.5,easeoutquad);

delayedcall(0.5, add(new_hlookat, view.hlookat, 10); tween(view.hlookat, get(new_hlookat),0.5);

delayedcall(1.5, add(new_hlookat, view.hlookat, -10); tween(view.hlookat, get(new_hlookat),0.5);



</action> …
Thank you!
Panoreal — to make and see this wonderful world! *whistling*

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

5

Tuesday, August 14th 2012, 4:45pm

stop the running action

Somebody tell how to stop the running the action?
*confused*
Panoreal — to make and see this wonderful world! *whistling*

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

6

Tuesday, August 14th 2012, 8:45pm

try


<action name="intro">
oninterrupt(break);
action(round-1); delayedcall(2.5, action(round-2););
</action>
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

7

Wednesday, August 15th 2012, 12:58am

oninterrupt(break);
The description of this operator should be work! I'll try it!
Thanks! *rolleyes*
Panoreal — to make and see this wonderful world! *whistling*

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

8

Wednesday, August 15th 2012, 1:49am

So, it's no works! *cursing*
I can not stop the same actions:
delayedcall(0.5, add(new_hlookat, view.hlookat, -10); tween(view.hlookat, get(new_hlookat),0.5);
if they have already running!

Stops all but the most shift view.v(h)lookat.

How?
Panoreal — to make and see this wonderful world! *whistling*

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

9

Wednesday, August 15th 2012, 2:49pm

did you also try oninterrupt(stopall()) ?
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

10

Wednesday, August 15th 2012, 7:00pm

Hi Zephyr!
I'm try many variants and many places where insert in code break; breakall(), stop (), stopall() and oninterrupt()+plus a listed.
Does not want to work!
Maybe I'm wrong embed code, or that it missed?

I attach an example of a panorama with the code(download link):
ars-test.zip

In my simple example, autotour started at the end of time (4 seconds), if this interval to intervene, it does not start (see events). But I need to do so you can stop the action and while it is running on the "Stop" button is pushed

PS: remove in code all variants of stop the runnings action

Any idea?
Thanks

Sorry for my English *whistling*
Panoreal — to make and see this wonderful world! *whistling*

This post has been edited 1 times, last edit by "Arsdezi" (Aug 15th 2012, 7:38pm)


Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

11

Wednesday, August 15th 2012, 8:54pm

try this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	<!-- actions /-->			   
	<action name="movestart">
		oninterrupt(stopall());
		showtext('[i]How stopped now?[/i]', INFOTEXT); action(move1); action(move2); 
	</action>

	<action name="move1">
		add(new_hlookat, view.hlookat, -100); lookto(get(new_hlookat), get(view.vlookat),get(view.fov), smooth(8,8,15), true, false);
		add(new_hlookat, view.hlookat, 100); lookto(get(new_hlookat), get(view.vlookat),get(view.fov), smooth(8,8,15), true, false);
	</action>

	<action name="move2">
		add(new_vlookat, view.vlookat, -150); lookto(get(view.hlookat), get(new_vlookat),get(view.fov), smooth(8,8,8), true, false);
		add(new_hlookat, view.hlookat, -350); lookto(get(new_hlookat), get(view.vlookat),get(view.fov), smooth(8,8,8), true, false);
		add(new_vlookat, view.vlookat, 80); lookto(get(view.hlookat), get(new_vlookat),get(view.fov), smooth(8,8,8), true, false);
		wait(blend);
		action(stopmove);
	</action>


you can use lookto instead of tween, and you don't need delayedcall, the animations will be executed after eachother. I'm not sure why stopall didnt stopp all the animation, maybe because the delayedcall already put them in queue. The true in stoptween means; use the shortest way, while the false means allow this animation to be interupted.
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

12

Wednesday, August 15th 2012, 10:34pm

Thank you very much for your variant, Zephyr!
But I need a performance of multiple movements of on the axes(x,y) and motion of plugin (Pictures).

That's why I used the tween(view.hlookat); tween(view.vlookat); with a delay time (delayedcall).
«Lookto» is a serial operation, please correct me if I'm wrong! *unsure*


PS: Klaus, needs your help! :)

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

13

Wednesday, August 15th 2012, 11:04pm

Not sure what you mean, but in my example I just animate the view.hlookat, but if you alter both view.hlookat and view.vlookat, then it will move diagonally.
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

14

Thursday, August 16th 2012, 1:07am

Yeah, sorry!
But then I do not know how to make a similar motion? ;-)

15

Thursday, August 16th 2012, 12:28pm

Hi,

a delayedcall can't be stopped at the moment,

the only way to stop it would be using a kind of 'stop' flag/variable, that will be checked in the delayedcall code,

e.g. here two helper actions for creating stop-able delayedcalls - there each delayedcall need to have an unique id and that id can be used for stopping it:

Source code

1
2
3
4
5
6
7
8
9
10
<!-- start_delayedcall(id, delay, code) --> 
<action name="start_delayedcall">
  set(delayedcall_flag_%1, true);
  delayedcall(%2, if(delayedcall_flag_%1 == true, %3 ));
</action>
				
<!-- stop_delayedcall(id) --> 
<action name="stop_delayedcall">
  set(delayedcall_flag_%1, false);
</action>


best regards,
Klaus

Arsdezi

Intermediate

  • "Arsdezi" started this thread

Posts: 174

Location: Ukraine

  • Send private message

16

Friday, August 17th 2012, 10:41pm

Thank you!
I'll take your advice and examples.
You are right, you need to stages start actions that can both run and not do the next step with the action.
PS: I understand can still use opertator — events.onidle + idletime?

17

Sunday, August 19th 2012, 9:45am

It would be great, if the delayedcall could work like the audio-plugin, where you can give each sound a specific name. Something like this: delayedcall(name,time,action)! And then we would be able to stop or even reset every delayedcall individually like "set(delayedcall[name].newtime,action);" or "set(delayedcall[name].stop);".
Somehow the if(delayedcall_flag)-routine just does´nt work, which makes the use of delayedcall-actions in very complex tours very hard.

Best regards
Nupsi

18

Thursday, January 31st 2013, 11:19am

Hi! I tried to understand how it works but alas ...
Please explain more ....
I already have a headache ....*sad*
thanks in advance...

With respect D.Drek

19

Friday, February 1st 2013, 10:09am

It would be great, if the delayedcall could work like the audio-plugin, where you can give each sound a specific name. Something like this: delayedcall(name,time,action)! And then we would be able to stop or even reset every delayedcall individually like "set(delayedcall[name].newtime,action);" or "set(delayedcall[name].stop);".
Somehow the if(delayedcall_flag)-routine just does´nt work, which makes the use of delayedcall-actions in very complex tours very hard.

Best regards
Nupsi


I´m still hoping for a feature like this *attention* Klaus, any word, if this could be implemented into krpano, would be really appreciated *squint*
This would make the use of delayedcall-actions sooo much easier!

Thanks and best regards
Nupsi

20

Friday, February 1st 2013, 11:31am

Hi,

that's already implemented for the next release - there will be these delayedcall actions:

Source code

1
2
3
delayedcall(time, code) 
delayedcall(id, time, code)
stopdelayedcall(id)


Best regards,
Klaus