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.

1

Tuesday, June 9th 2009, 11:55pm

'fly-out' hotspots

Hi,

I have uploaded a new 1.0.8 beta 8 version - build 2009-06-09,

there a new possibility for 'fly-out' hotspots was added:

<hotspot> has a new parameter - "flying":
  • possible values are from 0.0 to 1.0 (for dynamic tweening)
  • 0.0 = normal view
  • 1.0 = makes the hotspot independent from the panorama rotation and scaling (= locked to screen)
here is a example:
HTML: http://krpano.com/examples/108b8/example…ots/flyout.html
XML: http://krpano.com/examples/108b8/example…pots/flyout.xml

here the relevant code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<hotspot name="spot"
         url="image.jpg"
         distorted="true"
         ath="45"
         atv="54"
         scale="0.5"
         rx="-22.5" ry="-26.25" rz="-50.1"
         backup_rx="0"
         backup_ry="0"
         backup_rz="0"
         backup_scale="0"
         flying="0.0"
         onclick="if(flying == 0.0, flyout(), flyback() );"
         />
         
<!--
  flyout/flyback actions
  (for more stylish in/out moves play with different tweentypes and times)
-->

<action name="flyout">
  <!--
    save/backup the current rotation values!
    NOTE - it is important that the backup_* variables are predefined!
    this allows to save the variables at <hotspot> scope,
    if the variables where not predefined, they were saved globally
    and this would be a problem when more hotspots are using them!
  -->
  copy(backup_rx,rx);
  copy(backup_ry,ry);
  copy(backup_rz,rz);
  copy(backup_scale,scale);

  <!-- tween the rotations values to 0 for a flat screen view -->
  tween(rx, 0);
  tween(ry, 0);
  tween(rz, 0);
  tween(scale, 1.5);

  <!--
    tween 'flying' to 1.0,
    this makes the hotspot independent from the panorama rotation and scaling
  -->
  tween(flying, 1.0);
</action>

<action name="flyback">
  <!-- tween back to the stored backup values -->
  tween(rx, get(backup_rx));
  tween(ry, get(backup_ry));
  tween(rz, get(backup_rz));
  tween(scale, get(backup_scale));

  <!-- tween 'flying' also back to 0.0 -->
  tween(flying, 0.0);
</action>

Phil

Trainee

Posts: 97

Location: Texas

  • Send private message

2

Wednesday, June 10th 2009, 2:33am

Thanks Klaus!

3

Wednesday, June 10th 2009, 10:20am

Super!

...und danke für die Info/Entwarnung bezüglich der Verwendung von "onviewchange" und "enterframe-Events in as"!
best regards from www.PanAustria.com

Shanti

Intermediate

Posts: 301

Location: Puerto Vallarta

Occupation: Web Developer

  • Send private message

4

Wednesday, June 10th 2009, 11:40am

See what I said you are a machine!!!!, GREAT update :) I don't really use the flyout that much, but I am sure it will come in handy, and now oficially Krpano is WAY better than FPP (not that it wasn't before) I know its not a race.. but if it were, you'd be ahead now :D

5

Wednesday, June 10th 2009, 12:57pm

Thanks for this update

But I have some trouble with the zorder of image when they flying *wacko*

6

Wednesday, June 10th 2009, 3:40pm

Here http://www.visionrhd.com/site/photo/img.html

when i put the hotspot on center of the vr and flying image, trouble with the zorder

Amedee

Beginner

Posts: 33

Location: Brussels - Belgium

  • Send private message

7

Wednesday, June 10th 2009, 6:08pm

Hi Klauss!

Reading your code raises 2 questions...

First, you are using backup_* parameters in your hotspot definition. Are these real hotspot parameters, or can you actually bind any variable to a hotspot? (This might be interresting to define hotspot or plugins variables/properties...)

Secondly, your flyout/flyback actions do specify a 'scope' for the variables -- I would have expect to see something like 'hotspot[spot].rx' and not just 'rx'...
There seems to be some inheritance; how does this work and how can we differenciate between a 'local' variable with the same name?

Thank you in advance for the clarification.
Phil.

Tangent12

Trainee

Posts: 89

Location: Liverpool, UK

Occupation: Application Developer

  • Send private message

8

Wednesday, June 10th 2009, 9:34pm

Klaus, this functionality is fantastic, I was only thinking of asking if something like that is possible and here it is done.

Your commitment to ongoing development is astounding.

Great work.
Liverpool based panoramic photography, virtual tour and
web media organisation specialising in high quality web experiences.