Sie sind nicht angemeldet.

1

Sonntag, 5. April 2009, 23:41

moveto/lookto and zoomto together... ?

Hi !
I would like to associate to action together as transition from a pano to another...
If I use "lookto", first I have a move, then a zoom... (nearly to a right-angle)
I want the "move" to finish in the same time than the "zoom" (nearly to a sigmoid or something like "easeInOutSine")
So, I want to use the "tween code", but I don't know the correct syntax to have both in the same time...

Quellcode

1
2
3
4
<hotspot name="caserne"
			onclick="moveto(60,0);tween(zoomto,60,0,easeInOutSine);load(cncs_02.xml,null,MERGE);lookat(270,0,80);">
		   ...
</hotspot>


Thanks

David

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »sagedavid« (6. April 2009, 00:17)


2

Montag, 6. April 2009, 09:47

Hi,

the moveto/lookto/zoomto actions don't work on a time-basis,
the time they need depends on the distance between the current and
the destination view point,

you can use tweens too, but:

Quellcode

1
tween(zoomto,60,0,easeInOutSine);
will not work

to change the zoom you need to change the "view.fov" parameter, e.g.:

Quellcode

1
tween(view.fov,60,1,easeInOutSine);


you could change the hlookat/vlookat in the same way:

Quellcode

1
2
3
tween(view.hlookat,60,1,easeInOutSine);
tween(view.vlookat,0,1,easeInOutSine);
tween(view.fov,60,1,easeInOutSine);


best regards,
Klaus

3

Montag, 6. April 2009, 09:59

I gonna try,
Thanks a lot, Klaus ;-) !

4

Montag, 6. April 2009, 10:43

Ok, so... my code is this one, now :

Quellcode

1
2
3
4
5
onclick="tween(view.fov,10,2);
					tween(view.hlookat,75,2);
					tween(view.vlookat,0,2);
					load(pano_02.xml,null,MERGE);stopallsounds();
					action(hideallimages);lookat(270,0,80);">


The problem is :
- it load pano_02 before making the move...
Must I add a "wait time" for the pano loading ?

5

Montag, 6. April 2009, 10:57

Ok, I added "wait(1)", and it's ok...

Quellcode

1
2
3
4
onclick="tween(view.fov,60,1);tween(view.hlookat,70,1);tween(view.vlookat,0,1);wait(1);
					load(cncs_02.xml,null,MERGE,ZOOMBLEND(1,2));stopallsounds();
					action(hideallimages);
					lookat(270,0,80);">


The only problem is that my "lookat(270,0,80)" command - at the end, for the 2nd pano - doesn't take effect...


PS : with the "tween(hlookat)" command, it always turns "counter-clockwise"... It isn't "direct" : even if I'm at H=60, it turns all around to 70 *g* *cry* !!!

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »sagedavid« (6. April 2009, 11:15)


6

Dienstag, 7. April 2009, 13:27

Ok, too solve my problem of "bad landing" in the next pano, I've putted my "v & hlookat" and "fov" in the "view" code...

Now, an other BIG PROBLEM... It sounds like A BUG !
If I turn three times in my pano, and then click on the hotspot to the next one, krpano makes my turn back three times before the transition !!!!!!!!!!

If somebody can explain me...

It looks like if krp consider that, after one revolution, 0° is no more 0° but 360°, two revolutions 720°, etc.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »sagedavid« (7. April 2009, 13:48)


Amedee

Anfänger

Beiträge: 33

Wohnort: Brussels - Belgium

  • Nachricht senden

7

Mittwoch, 8. April 2009, 11:56

Well...

It's not really a bug, it is inherent to the tween which just go from one value to another.

It may sound strange that the vlookat/hlookat go beyond the 360°, but even if we would constraint this, it would not solve the problem where you would be at e.g 270° and want to go to 10°: it will rotate 260° counter-clockwise while the shortest path is 100° clockwise.

If you want to tween your hlookat / vlookat, I would sugget to normalize your coordinates before tweening, so if you want to tween to (70,0), you could do something like:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
action(normalizeView,70,0); <your tween stuff to (70,0) here >

	<action name="normalizeView">
		set(normalized, 1);
		sub(hdelta, view.hlookat, %1);
		if(hdelta GT 181, inc(view.hlookat, -360); set(normalized, 0););
		if(hdelta LT -181, inc(view.hlookat, 360); set(normalized, 0););
		sub(vdelta, view.vlookat, %2);
		if(vdelta GT 181, inc(view.vlookat, -360); set(normalized, 0););
		if(vdelta LT -181, inc(view.vlookat, 360); set(normalized, 0););
		if(normalized LT 1, action(normalizeView, %1, %2););
	</action>
Phil.

8

Mittwoch, 8. April 2009, 13:34

Hi Amedee - a great solution!