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

Sonntag, 7. März 2010, 14:05

Help! Can't set the correct tweening sequence!

Hi! My skill level in XML programming is just at the entry, so I badly need some help with my problem. Hope it is really easy for any experienced guys.

I am trying to set a little animation for my virtual tour. What I need to do is to start the scene with some position and once it is loaded I need it to zoom out anr look at the other specified position. The initial co-ordinates are set in the hotspot, that leads to the scene. And they are:

Quellcode

1
lookat(85,0,40);


Once the new scene is loaded I need it to smoothly zoom out to FOV=80 and then look to position +224,0

So for the new scene onstart event I use:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
	<scene name="scene2" onstart="action(startscene);">

		<action name="startscene">
			showtext('[b][i]scene 2[/i][/b]', infostyle);
			plugin[box].selectIdItem(2);

		wait(load);

		tween(view.fov,80,1.0,easeInOutQuad );
		
			tween(view.hlookat, 224, 0.5, easeInOutQuad );
			tween(view.vlookat, 0,   1.5, easeInOutQuad );

			</action>


Despite the tweening commands are as above the action in any case goes first look at 224,0 and then zoom to FOV 80.

Any help how to resolve the problem is warmly welcome.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »boxx1« (7. März 2010, 14:15)


2

Sonntag, 7. März 2010, 14:30

Hi boxx1,

Have a look to the moveto(toH,toV,motiontype) , zoomto(fov,motiontype) and lookto(toH,toV,fov,motiontype) actions: http://krpano.com/docu/actions/#lookto

So, your code should be:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
<scene name="scene2" onstart="action(startscene);">

	<action name="startscene">
		showtext('[b][i]scene 2[/i][/b]', infostyle);
		plugin[box].selectIdItem(2);

		wait(load);

		zoomto(80,smooth());
		
		moveto(224,0,smooth());

	</action>


SAlut.

3

Sonntag, 7. März 2010, 14:40

Yes it works great. I experimented with those commands, but with no success. Now it is perfect and smooth.

By the way, what was wrong with the tween command? Isn't it working in the order that you write it? It seems that it has some default priority order, like rotation first or something.

Thanks again for your help.

4

Sonntag, 7. März 2010, 15:23

Hi boxx1,

Zitat

By the way, what was wrong with the tween command?
Each tween are executed in "parallel"...
So, in your example, the first tween has a time of 1 while the next tween has 0.5... that's why the first tween seems to be executed after the next one...
To make tweens to be executed in "series", you have to set a WAIT flag to the tween.
  • WAIT flag for the tween() action
    • waiting until this tween has been finished before the next action command will be executed
    • usage:

      Quellcode

      1
      
      tween(variable,destinationvalue,time,tweentype,WAIT);

SAlut.

5

Dienstag, 9. März 2010, 12:01

Many thanks, michel.

But I have another question.

The aim of this tweening and animation was to create the feeling of the space and direction for the person who is using a virtual tour.

So once he moves all the way forward he faces all the "FORWARD" hotspots. When the new scene opens, it shows the position where the previous scene was (using the lookat(85,0,40);command), then zooms out and rotates to face the direction and shows the next "FORWARD" step. This is achieved by

Quellcode

1
2
3
zoomto(80,smooth());

moveto(224,0,smooth());


So when you go the virtual tour all the way forward it works great and makes a feeling of the 3D walk.
But when you try to move back it is messing down all your feeling of direction. Because it
  • turns onto the back hotspot,
  • then zooms it in,
  • then loads the previous scene facing the position where you have just left from,
  • zooms out,
  • and the messy part is right here: it makes a slight move and returns you to the same position, where you have just left from.
Here is an example: http://v-city.eu/est/tours/fairs/meremess/meremess.html

What it should do is to rotate the view to the other BACKWARD hotspot on the loaded scene.

So my question is:
Is it possible to programm the behaviour of the next scene in the loadcsene description of the hotspot?
In my example i need to programm the initial position of the loaded scene, initial FOV, change of FOV and rotation to a specific position.

My hotspot looks like this:

Quellcode

1
2
3
4
5
6
<hotspot name="spot-1-forward" url="spots/fwd.png" ath="+265" atv="+10" scale="0.85" zoom="true"
     alpha="0.8" 
     onover="freezeview(true);tween(alpha,1);tween(scale,1.2);showtext(STEP FORWARD, arrows);"
     onout="freezeview(false);tween(alpha,0.8);tween(scale,0.85);"
     onclick="freezeview(false);lookto(265,1);zoomto(50,smooth(200,200,400));loadscene(scene2, null, MERGE, BLEND(1));lookat(85,0,10);"
     />


lookat(85,0,40); works great but helps only with the initial position of the new scene.

6

Dienstag, 9. März 2010, 14:32

To be honest, I do not really read your question accurately *smile* ... So my answer could be no accurate too ;-) ...

I suppose that you are looking to the looktohotspot(hotspotname,fov*,motiontype*) action.
So, your hotspot code could be:

Quellcode

1
2
3
4
5
6
<hotspot name="spot-1-forward" url="spots/fwd.png" ath="+265" atv="+10" scale="0.85" zoom="true"
     alpha="0.8" 
     onover="freezeview(true);tween(alpha,1);tween(scale,1.2);showtext(STEP FORWARD, arrows);"
     onout="freezeview(false);tween(alpha,0.8);tween(scale,0.85);"
     onclick="freezeview(false);looktohotspot(spot-1-forward,50,smooth(200,200,400));loadscene(scene2, null, MERGE, BLEND(1));lookat(85,0,10);"
     />


Hope this is what you are looking for...

SAlut.

7

Dienstag, 9. März 2010, 17:14

Here is a snippit from what I use. I believe it achieves most of your wishes, although this code does not pan. You may have to modify it for scenes but basically follow the looktos and zoomtos.


This code zooms into the hotspot clicked and then loads the pano facing the direction from which it zoomed from . Then it zooms out to 90 degrees fov.

Of course, you must change the cords. of 176,0 to the cords of where the hotspot that goes back to the previous scene is.




onclick="looktohotspot(secondbath);
loadpano(secondbath.xml, null, MERGE, BLEND(1));
lookat(176,0,10);
zoomto(90,smooth(720,50,360));"

8

Mittwoch, 10. März 2010, 12:35

Thank you friends. With your hints I solved my problem.
I will come back later with the result of the tour and try to explain the solution. But now need to push up the work, as the deadline is tomorrow. *cool*

Ähnliche Themen