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.

  • »Kev-in-spain« ist der Autor dieses Themas

Beiträge: 123

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

1

Freitag, 9. September 2011, 21:03

animated plugin

I'm trying to create a plugin which will animate onover and return to frame 1 onout. Also, the animation must only run once i.e. frames 1 to 40 and stop.
I can do this by using the standard krpano animate code and changing the 0 for 39 as follows:

<action name="animate">
inc(frame,1,get(frames),39);
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.06, animate() );
</action>
My problem is, I don't know how to get it to return to frame 1 onout so that it is ready for the next mouseover action.

Any ideas anyone?

Thanks

Kev.

Beiträge: 1 836

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Freitag, 9. September 2011, 21:44

your minimum frame is 39?
frames is unknown

onout"set(frame,1);"

I think your inc max and min are mixed up and don't even make sense if you don't want it to repeat.. the documentation says it loops using that.
inc(variable,byvalue*,max*,min*)
dec(variable,byvalue*,min*,max*)

<action name="animate">
ifnot (frame == 40,inc(frame,1));
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.06, animate() );
</action>
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

  • »Kev-in-spain« ist der Autor dieses Themas

Beiträge: 123

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

3

Montag, 12. September 2011, 05:17

Thanks Sacha,

As you can tell, I'm learning by trial and error and don't have as much understanding of xml code as I would like. I found (by trial and error) that by changing the 0 to 39 (my number of frames) I got the effect I was looking for.
The corrected code that you gave me also works however, the onout"set(frame,1);" is not working for me. Yes, it sets the plugin back to frame 1 but it immediately runs through the animate action again.
What I need is for it to set to frame 1 so that it is ready to animate again onover.

Kev

Beiträge: 1 836

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

4

Montag, 12. September 2011, 06:05

<action name="animate">
ifnot (delaykilled ==true,
ifnot (frame == 40,inc(frame,1));
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.06, animate() );
);
</action>


onout"set(frame,1);set(delaykilled,true)"

and before you animate();
set(delaykilled,false);animate();

Nothing really xml code here.. its just basic programming. My way is straightforward logic. I'm sure there is a cleverer method.
Try reading some programming tutorials online and try to stop trial and error in favor of very slow understanding of what you are trying to achieve and think it through step by step. That's the only way to learn. I rebelled against learning to programming anything until about 6 years ago.. It was a futile effort.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Beiträge: 1 836

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

5

Montag, 12. September 2011, 06:15

go back to your animate action and
onout="breakall();mul(ypos,1,frameheight);txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));"

would be even better since it would stop the running action, and reset the frame at the same time.
Unless you have other actions running, then you have to go back to killing the action personally like I did before.

<action name="animate">
ifnot (frame == 40,inc(frame,1));
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.06, animate() );
</action>
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour