1

我在 Flash (as3) 中的专有全景查看器应用程序顶部覆盖了一些可点击的热点,我需要确保热点根据用户放大/缩小时不断变化的视野进行缩放,但我是不确定使用什么公式。

我分别设置了 90 和 25 的最大和最小视野。我得到了一些关于如何计算图标比例的建议:

来自全景软件的制造商:

Scale => 1/tan(FoV)

这似乎对我不起作用。和:

scalar += (ZOOM_SCALE_UPPER - ZOOM_SCALE_LOWER) * ( ZOOM_LIMIT_OUT - tempFOV   )/( ZOOM_LIMIT_OUT-ZOOM_LIMIT_IN) ;

hotspot.scaleX = hotspot.scaleY = scalar;

让我靠近,但在某些时候,即使全景图继续缩放,热点也会停止缩放。我以为我可以做类似的事情:

diffFOV = previousFOV - currentFOV.
hotspot.scale = currentScale*(1-diffFov)

但这也不完全正确。一切都变得太大或太小。

有任何想法吗?

4

1 回答 1

1

你可能想多了。

//assume we change the scale
var NEW_SCALE:Number = currentScale*(1-(previousFOV-currentFOV));

//1. change the scale of the parent containing both the view and the hotspots
viewSprite.scale = NEW_SCALE;
//this way the hotspot and the panorama will scale together

//2. if they are not in the same parent... then set them both to the same view
hotspot.scale = panorama.scale;

如果它们没有在它们的中心点上注册,您唯一可能需要做的就是重新定位。

于 2013-01-24T21:06:08.523 回答