You are not logged in.

AlexSevas

Professional

  • "AlexSevas" started this thread

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

1

Monday, January 21st 2013, 10:44am

Distorted hotspots behave strangely while dragging

Dear Klaus and other Krpano specs,

I’ve encountered another interesting challenge while playing with distorted
hotspots. I’ve been trying to make a sort of interactive pano where one could
take, say, a cell phone from the table, move it around, then “hide” it in
someone’s pocket. But I’ve noticed that distorted hotspots located on down or
up cubefaces behave somewhat strange while running “draghotspot” action.

I guess this is due to margins distorted hotspots have, because distorted hotspots
located in horizontal cubes behave quite normal. Is there any way to tweak the
“draghotspot” action to eliminate such hotspot behavior?

Maybe, someone have a guess how to do that?

The example pano is below (flash only), inside it click the red and white cell phone lying
on the table near a fish tin can and drag it to see the way it rotates far off
where the mouse handcursor is.

https://dl.dropbox.com/u/50930222/krpano…on/question.swf


Thank you a
lot for any possible ideas to fix this!

Regards,

Alexey
Regards,

Alexey

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Monday, January 21st 2013, 1:03pm

nice idea ;-)

maybe set the origin of the phone to mouse/cursor?

Source code

1
origin="cursor"


*question*

So..
Onclick the phone .. Set phone origin to cursor

Tuur *thumbsup*

This post has been edited 1 times, last edit by "Tuur" (Jan 21st 2013, 1:26pm)


AlexSevas

Professional

  • "AlexSevas" started this thread

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

3

Monday, January 21st 2013, 2:02pm

Thank you, Tuur, for you prompt help,

I've just tried setting the hotspot's origin to cursor both via onclick="set(hotspot[..].origin,cursor);" then by just setting it in the hotspot attributes via origin="cursor". But neither works, I think it's because hotspots can't have origin, only textstyles and progress bars can have that, or maybe I'm doing something wrong.

The hotspot's code is as follows:


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 <hotspot name="stol"
url="%SWFPATH%/hotspots/tel.png" 
distorted="true"
	enabled="true"
ath="0"
atv="90"
origin="cursor"
zorder="2"
width="36.809816"
height="62.8834356"
edge="lefttop"
ox="-139.57055"
oy="192.484663" 
	handcursor="true"
alpha="1.0"
ondown="action(draghotspot);tween(hotspot[stol_background].alpha,1,0.1);"
onup="looktohotspot(stol,60,linear(100));tween(alpha,0,1);playsound(steal,%SWFPATH%/sound/steal.mp3,1);"
onclick="set(hotspot[stol].origin,cursor);"

/>




I suspect the reason for such jumpy behavior is the ox and oy margin needed for perfect hotspot alignment onto cubeface. But I'm quite puzzled about adjusting the draghotspot (); action as to ignore this margin while moving...
Regards,

Alexey

4

Tuesday, January 22nd 2013, 5:00pm

Hi,

first - there is no origin="cursor" setting for hotspots

About the dragging - the draghotspot action is just moving the ath/atv point, so correct - the additional ox/oy position adjustments are the reason for the 'strange dragging behavior' .

Maybe see this tutorial:
Example/Tutorial - Extract a Distorted Hotspot from any kind of Pano Image (with perfect pixel alignment)

By creating the hotspot this way, the hotspot will be centered at the ath/atv position without any ox/oy shifting.

Best regards,
Klaus

Alexey Tkachenko

Professional

  • "Alexey Tkachenko" started this thread

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

5

Tuesday, January 22nd 2013, 6:12pm

Thank you so much, Klaus!

So, my guesses were right *smile* , the ox/oy margin is the reason. I'll read through your tutorial carefully and make the hotspots using your guidelines.
Thank you a lot, once again!!! *smile*
Regards,

Alexey