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

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

1

Montag, 21. Februar 2011, 16:34

Wrong xml structure?

Hi guys,
Can anyone advise me as to what I have done wrong in this xml?: http://www.projectsolutions.es/demos/yomec/tour.xml
The tour ( http://www.projectsolutions.es/demos/yomec/tour.html ) does everything I want it to do but takes forever to load.
The xml does contain quite a few hotspots, plugins and actions, but I've seen other examples with just as many, and more, and they don't take as long to load.

As always, any advice will be gratefully recieved.

2

Montag, 21. Februar 2011, 16:55

it actually loaded quite fast for me in the US. that tour is not that large at all. to reduce loading times you could use only 1 picture plugin and 1 text plugin. then create an action that sets the appropriate image and text based on whatever hotspot was clicked. craete an action and set it to each hotspot. you have a ton of replicated code for actions, plugins and hotspots. use some varaibles like below. also you could set a 'style' on the of the hotspot or plugin code so you do not have to replicate the same code taht way also.

<action name=showstuff>
set(plugin[photo].url, %1);
set(plugin[text].url, %2);
set(plugin[photo].visible, true);
set(plugin[text]/visible, true);
<action/>

hotspot1
onclick="showstuff(pathtoimageurl, pathtotexturl);"

hotspot2
onclick="showstuff(pathtoimageurl2, pathtotexturl2);"


right now you are loading every jped and text image even when they are not needed.

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

3

Montag, 21. Februar 2011, 19:02

Thanks VN2011.
It's all a bit much for my beginners brain *confused* but I think I understand the concept.
I'll go away and try it but I have a feeling I'm going to be back!

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

4

Montag, 21. Februar 2011, 20:23

Ok.... I knew it couldn't be that simple!

Here's what I did:

<action name="showImage">
set(plugin[photo].url, %1);
set(plugin[text].url, %2);
set(plugin[photo].visible, true);
set(plugin[text]/visible, true);
</action>

<plugin name="photo" url=""
align="center"
visible="false"/>

<plugin name="text" url=""
align="center"
y="250"
zorder="10"
visible="false"/>

<hotspot name="spot1" style="cog_hotspot" ath="6.3" atv="-1.4" onhover="showtext(Clique para más info, buttonstyle);" onclick="showImage(url=graphics/car_lift.png,url=graphics/text_area.png)" />

When I click on spot1 in the tour I get an error message:

WARNING: not local trusted - ExternalInterface disabled!
ERROR: download of "url=graphics/car_lift.png" failed
ERROR: download of "url=graphics/text_area.png" failed

Where did I go wrong?

5

Montag, 21. Februar 2011, 20:49

Hi,

see the red marked parts here - they are wrong:
hotspot name="spot1" style="cog_hotspot" ath="6.3" atv="-1.4" onhover="showtext(Clique para más info, buttonstyle);" onclick="showImage(url=graphics/car_lift.png,url=graphics/text_area.png)" />

When I click on spot1 in the tour I get an error message:

WARNING: not local trusted - ExternalInterface disabled!
ERROR: download of "url=graphics/car_lift.png" failed
ERROR: download of "url=graphics/text_area.png" failed
best regards,
klaus

6

Montag, 21. Februar 2011, 20:59

you do not need the url= part since the %1 and %2 variables are only for the path itself. but you are headed in the right direction!

onclick="showImage(graphics/car_lift.png,graphics/text_area.png)"

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

7

Montag, 21. Februar 2011, 21:11

Hmm... why didn't I think to try that?!

Next thing is, why is y="250" & zorder="10" being ignored?

8

Montag, 21. Februar 2011, 21:13

why should it have been ignored?

btw - here is also something wrong: (red)

Zitat

set(plugin[text]/visible, true);

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

9

Montag, 21. Februar 2011, 22:00

Thanks guys, you've got me out of another hole.

Another question;
How do I scale the plugin images to screen size?
I've tried using % & prop but then the image scales on both x & y at the same time.
What I like to use is, first expand width followed by height using this action:
tween(plugin[photo].width, 1074,0.2,easyOut,
tween(plugin[photo].height, 725,0.3,easyOut);

10

Montag, 21. Februar 2011, 22:07

here a solution:

Quellcode

1
tween(width,get(stagewidth),0.2,easeOutQuad, set(width,100%); tween(height,get(stageheight),0.2,easeOutQuad, set(height,100%) ) );


first the width will get tweened to the current stagewidth,
and then will it be set to 100% to keep the full screemwidth also on resizing,
then the the same will be done with the height,

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

11

Dienstag, 22. Februar 2011, 11:52

Thanks Klaus,
I've entered the code you suggested as follows:

<action name="showImage">
set(plugin[photo].url, %1);
set(plugin[text].url, %2);
tween(view.fov, 120,0.7,,
tween(plugin[photo].width,get(stagewidth),0.2,easeOutQuad, set(width,70%);
tween(plugin[photo].height,get(stageheight),0.2,easeOutQuad, set(height,prop);
tween(plugin[text].scale, 0.56,0.2,,
tween(plugin[text].scale, 0.52,0.05,,
tween(plugin[text].scale, 0.55,0.1,,
loadscene('scene_2',null,KEEPALL,BLEND(1.2))))))));
</action>

However, no matter what percentage I put for the width, the image still opens full screen and is in propotion to the screen size rather than in proportion with itself.
What have I done wrong? *confused*

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

12

Dienstag, 22. Februar 2011, 21:14

I've sorted it out and feel a bit foolish as it is so obvious *wacko*

<action name="showImage">
set(plugin[photo].url, %1);
set(plugin[text].url, %2);
tween(view.fov, 120,0.7,,
tween(plugin[photo].width,get(stagewidth),0.2,, set(plugin[photo].width,70%);
tween(plugin[photo].height,get(stageheight),0.2,, set(plugin[photo].height,prop);
tween(plugin[text].scale, 0.56,0.2,,
tween(plugin[text].scale, 0.52,0.05,,
tween(plugin[text].scale, 0.55,0.1,,
loadscene('scene_2',null,KEEPALL,BLEND(1.2))))))));
</action>

Next issue:
On the good advice of VN2011, I'm using the following action to show an image which changes the colour of a car:
<action name="changeTruck">
set(hotspot[truck].url,%1);
tween(hotspot[truck].alpha,1,1.2);
</action>
This works perfectly for one colour change but when another colour is selected, the first colour disappears immediately. as the url is replaced with the onClick command.
What I would liketo happen is for the selected colour to fade out as the new one fades in.
Possible?

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

13

Freitag, 25. Februar 2011, 12:44

Any ideas guys?

14

Freitag, 25. Februar 2011, 22:39

sorry, what is the question or problem? what do you want to do?

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

15

Freitag, 25. Februar 2011, 23:22

On the good advice of VN2011, I'm using the following action to show an image which changes the colour of a car:
<action name="changeTruck">
set(hotspot[truck].url,%1);
tween(hotspot[truck].alpha,1,1.2);
</action>
This works perfectly for one colour change but when another colour is selected, the first colour disappears immediately. as the url is replaced with the onClick command.
What I would liketo happen is for the selected colour to fade out as the new one fades in.
Possible?
Hi Klaus,
Here's an example of what I would like to happen: http://www.projectsolutions.es/demos/yomec/tour.html but I would like to use a different method (see the quote) as the way I have done it takes too long to load the tour.

16

Freitag, 25. Februar 2011, 23:31

Hi,

okay, I think I understand,
but in this case you would need several hotspots - a hotspot for each color,
and then instead of changing the url fade all other hotspots out and only the selected in,
(note - when you're tweening a value once (e.g. when fadeing all out), and then tween
that value again with an other value, then the first tween will automatically stop,
so you can do that - fade out all + fade in only one)

e.g. do this with some actions:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<action name="fadeout">
 tween(hotspot[%1].alpha, 0.0, 0.5, default, set(hotspot[%1].visible,false));
</action>

<action name="fadein">
 set(hotspot[%1].visible,true);
 tween(hotspot[%1].alpha, 1.0, 0.5, default);
</action>

<action name="fadeout_all_colors">
 fadeout(color1);
 fadeout(color2);
 fadeout(color3);
 ...
</action>

<hotspot name="color1" ... onclick="fadeout_all_colors(); fadein(color1);" />
<hotspot name="color2" ... onclick="fadeout_all_colors(); fadein(color2);" />
...


one more note - the visible=true/false in the fadein/fadeout actions is
done for better rendering performance, all hotspots with visible=true (even with alpha=0) can be slow,

best regards,
Klaus

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

17

Freitag, 25. Februar 2011, 23:50

That's pretty much the way I have it at the moment.
The problem is, all the hotspots load at the start of the tour which slows dow the loading time.
What I wanted to use was something like:
<hotspot name="truck"
url=""
ath="83.47264086546944" atv="4.018223006068532" distorted="true"
width="740" height="215"
scale="0.6220326732917445" rx="1.5" ry="6.5" rz="0.23177069875548434"
handcursor="false" alpha="0.00" />

and use the action to call the url:
<action name="changeTruck">
set(hotspot[truck].url,%1);
tween(hotspot[truck].alpha,1,1.2);
</action>

This works perfectly for one colour change but when another colour is selected, the first colour disappears immediately. as the url is replaced with the onClick command.
What I would liketo happen is for the selected colour to fade out as the new one fades in.

18

Freitag, 4. März 2011, 12:28

Hi,

in this case you would need at least two hotspots - a current one - and one for loading the next,
when the loading of the next one was done - fade out the old one + fade in the new one,
and then in the next call both hotspots must be swapped,
implementing that should be possible but can be tricky of course,

best regards,
Klaus

Kev-in-spain

Fortgeschrittener

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

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

19

Freitag, 4. März 2011, 20:22

Thanks Klause, I think I've sorted it out. As you said 'tricky'!

Going back to the issue of stagewidth/height earlier in this thread, I'm using the following action (as you suggested) to reveal a plugin image.
The relevent part is in red font:

<action name="showImage">
set(plugin[photo].url, %1);

set(plugin[text].url, %2);
tween(view.fov, 120,0.7,,
tween(plugin[photo].width,get(stagewidth),0.5,, set(plugin[photo].width,prop);
tween(plugin[photo].height,get(stageheight),0.5,, set(plugin[photo].height,70%);

tween(plugin[text].scale, 0.56,0.2,,
tween(plugin[text].scale, 0.52,0.05,,
tween(plugin[text].scale, 0.55,0.1,,
loadscene('scene_2',null,KEEPALL,BLEND(1.2))))))));
</action>

It works, and the image opens to scale and proportion but not before first opening to full screen and then shrinking down to the correct size in proportion to the screen.
I've tried several things to try to rectify it myself but, due to my inexperience, without success.
Any idea where I've gone wrong?

20

Donnerstag, 10. März 2011, 15:16

Hi,

what exactly should the photo image do?

best regards,
Klaus