Sie sind nicht angemeldet.

21

Sonntag, 24. Oktober 2021, 00:58

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.


Klaus, is there any way to calcualte the correct scale?

I have a flat Panorama with the size of 170624x98780 Pixels and hfov="1.00" vfov="0.578930".
I figured out for this one the scale is around 0.00005027.

However I need a way to calculate it and can't figure out how.

Thank you for any help!

22

Samstag, 30. Oktober 2021, 14:29

Hi,

here the code to calculate the scale for a hotspot to give it a size that is relative to the pixel-dimensions of the source image (for flat multires panos):

Quellcode

1
2
set(hotspot[s].width, A_PIXEL_SIZE_RELATIVE_TO_THE_PANO_IMAGE_SIZE);
calc(hotspot[s].scale, tan(hotspot[s].width / image.level[calc(image.level.count-1)].tiledimagewidth * Math.PI/180.0 * 0.5) * 1000 / hotspot[s].width);


Best regards,
Klaus

Ähnliche Themen