You are not logged in.

## Hotspots in a flat pano

Thursday, June 23rd 2011, 4:20pm

### Hotspots in a flat pano

Just a simple question: is that possible?
I assume the 'ath' and 'atv' properties of a hotspot are not relevant in a flat pano. Or can they also be defined in pixels?

Sage

Posts: 3,189

Location: Netherlands

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

Thursday, June 23rd 2011, 4:44pm

yes is possible!

but the ath atv numbers are really small

Tuur
http://www.virtualtuur.com
Skype:studiotuur

Thursday, June 23rd 2011, 5:36pm

Okey thanks! Can you explain how I calculate these pixel values? And from which point are they measured? The top left corner?

Saturday, June 25th 2011, 2:10pm

Hi,

a flat pano in krpano is typically defined as spherical or cylindrical pano with a hfov (=horizontal field of view) of 1.0,

that means the whole image is just 1.0 degree wide in '3D space', so it will look flat,

the hotspot ath/atv coordinates are also within these range,
so for at pano with hfov=1.0 they should be in the range -0.5 to +0.5,

calculating the ath/atv from the source pixel coordinates is possible,
just:

### Source code

```1
2
```
```ath = (source-pixel-x / source-pixel-imagewidth - 0.5) * image-hfov
atv = (source-pixel-y / source-pixel-imageheight - 0.5) * image-vfov```

if you don't know the image-vfov:

### Source code

```1
```
`image-vfov = image-hfov * source-pixel-imageheight / source-pixel-imagewidth`

best regards,
Klaus

Trainee

Posts: 53

Location: Moscow, Russia

Thursday, June 30th 2011, 9:18pm

Hi!
I have the similar problem:
If zoom="true" my hotspot (png image) becomes invisible on the flat pano
Default zoom="true" and the hotspot is visible. But I realy need to change hotspot size together with the pano when zooming

This post has been edited 1 times, last edit by "Valentin" (Jun 30th 2011, 9:34pm)

Saturday, July 2nd 2011, 1:10pm

Hi,

for flat panos and zoom="true" you would need a very small scale for the hotspot,

e.g. try:

### Source code

```1
```
`<hotspot .. zoom="true" scale="0.01" ... />`

best regards,
Klaus

Trainee

Posts: 53

Location: Moscow, Russia

Tuesday, July 5th 2011, 8:32am

I plan to make animation like to the Interactive Area example (red/blask car) in the flat pano... But I don't understand how to calculate 1pixel-to-1pixel size of the hotspots.

Tuesday, July 5th 2011, 9:08pm

Hi,

do you mean that example here:
Example/Tutorial - interactive area in the pano (aligned distorted hotspot)

for flat panos that would be a bit different of course but it should be possible,
I will try to make an example/tutorial for that,

best regards,
Klaus

Trainee

Posts: 53

Location: Moscow, Russia

Friday, July 8th 2011, 11:26am

Thank you very much.

Thursday, September 8th 2016, 8:15pm

i tried to add hotspot on flat image using toureditor, the arrow of the hotspot is seen so big, bigger than the screen covering the whole image.

Here is the screen shot of toureditor - https://drive.google.com/open?id=0B_Wvk5…ZEpGa045Q0t6UEk

The white area on the image is hotspot.

So i added scale = " 0.01" on hotspot. The hotspot arrow got small but when i hover it, it again becomes very big. Bigger than the image.

Update -

Open the second image of beach and hover over the hotspot arrow.

This post has been edited 3 times, last edit by "mt7" (Sep 12th 2016, 2:12pm)

Friday, September 9th 2016, 9:39pm

Hi,

setting a small scale is already correct.
Or using non-zoomed/non-distorted hotspot, they have always the same size regardless of the pano zoom.

The reason why the hotspot is large, is that a flat pano has only a very small fov (hfov=1.0 by default) - see the posts above.

Best regards,
Klaus

Saturday, September 10th 2016, 8:12am

My hotspot code -

<hotspot name="spot1" style="skin_hotspotstyle" ath="0.313" atv="-1.449" linkedscene="scene_3_bhk_kitchen_compressed" scale ="0.3" zoom="false" />

when i add zoom = false, the hotspot is not visibile..

And the position of the hotspot changes when i scale it down - scale = "0.02"

so how can i stop zooming on hover and position it correctly. As using tour editor the hotspot is very big and after it add scale it changes its position..

I tried this code but didn't work. I might be using it wrong. So how should i use this code -

ath = (source-pixel-x / source-pixel-imagewidth - 0.5) * image-hfov
atv = (source-pixel-y / source-pixel-imageheight - 0.5) * image-vfov

image-vfov = image-hfov * source-pixel-imageheight / source-pixel-imagewidth

Thank you..

Saturday, September 10th 2016, 1:54pm

I am having the same problems putting a hotspot on a flat pano. After fiddling around with the settings I found that when you make zoom="false" and leave the distorted at the default of "false" and you also set your scale back to 1.0 and adjust the ath="0" and atv="0" you will get a hotspot on a flat pano that is the same size as the original hotspot icon image in my case 20px X 20px centered on the flat pano. You can adjust it from there to where you want it. I think the combination of zoom="false" and small scale was making it invisible. Also the ath and atv need to be corrected to very small values or else it ends up off screen.

Saturday, September 10th 2016, 5:06pm

@lschaudies

@klaus.krpano

I set zoom to false and scale to 1.0 and ath and atv to 0 but it didn't work..the arrow is not visible but the mouse pointer become hand pointer showing hotspot is there on half the screen means it is still big..

<hotspot name="spot3" style="skin_hotspotstyle" ath="0.0" atv="0.0" linkedscene="scene_3_bhk_kitchen_compressed" zoom = "false" scale = "1.0" />

Am i doing it right?

And after we make it small how to place the hotspot at correct position as we cannot use the toureditor here?

This post has been edited 1 times, last edit by "mt7" (Sep 10th 2016, 5:26pm)

Wednesday, September 14th 2016, 8:53pm

I wouldn't try using the tour editor for this. Sounds like you need to change the actual size of the graphic with Photoshop or similar editor. All the problems are related to getting the size etc. right relative to a 1degree field of view. I was using a 35px by 35px version of the default arrow. If your graphic is larger you can try reducing the scale appropriately. Try different scales down to I believe .01 is as small as it will go. That wasn't small enough for me using the supplied graphic so I made a smaller version of it.

Thursday, September 15th 2016, 9:14am

Hi,

when using a zoom=true or distorted=true hotspot on flat panos, just use a very small scale value (e.g. 0.001 or every smaller). That's because the scale is based on the pano-zoom and relative to a 360 pano - and a flat pano is a only 1 degree pano.

Without zoom or distorted set true, a scale of 1.0 should be used, because then the scaling is screen-based.

The ath/atv positions in a flat pano are in the range -0.5 to +0.5.

### Quoted

I set zoom to false and scale to 1.0 and ath and atv to 0 but it didn't
work..the arrow is not visible but the mouse pointer become hand pointer
showing hotspot is there on half the screen means it is still big..

Best regards,
Klaus

Friday, September 16th 2016, 2:36pm

Hi,

Here's the link to the tour -

I got the hotspot arrow small and is seen on the image with zoom = true, distorted = true and scale = 0.001

But when i hover the hotspot the arrow becomes very big and becomes invisible. Please check the tour - open the second image of beach..

How to avoid that?

This post has been edited 1 times, last edit by "mt7" (Sep 16th 2016, 8:53pm)

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

Friday, September 16th 2016, 4:01pm

e.g. edit your skin_hotspotstyle style in skin/vtourskin.xml and adapt onover and onout scaling to something like:
onover="if(zoom EQ true,tween(scale,0.002),tween(scale,0.55) );"
onout="if(zoom EQ true,tween(scale,0.001),tween(scale,0.5) );"

Friday, September 16th 2016, 6:34pm

Hey thanks a lot. It worked.

Friday, September 16th 2016, 7:18pm

Hi,

When i add flat image on make vtour normal droplet, it convert normal flat image into spherical and shows this message-

### Source code

```1
```
`converting sphere to cube format`
and

But sometimes it gives this message -

### Source code

```1
2
```
```WARNING: 47326254.jpg is not a 360x180 panorama image!         Imagesize=840x460px
Type of the panorama image? (0=None/Skip, 1=Flat, 2=Spherical, 3=Cylindrical)Input:```

and i select option 1 and it keeps the image flat as i want.

So how to disable automatic conversion of flat image to cube / spherical so i can select which images i want to be pano and which i want to keep flat / normal image.

Update - I got it working by increase the width ss it does not follow the ratio and it ask for the input.

This post has been edited 1 times, last edit by "mt7" (Sep 18th 2016, 2:42pm)