[SOLVED] How to calculate displayed width/height of distorted hotspot for certain view.fov value?

  • Hello.

    There is an distorted image hotspot. I need to learn width and height of that hotspot for certain fov value. Not image size or original hotspot size but width/height of hotspot's DOM element for any certain view.fov.

    So I wander how to calculate that DOM element width/height. Maybe there is hotspot's property that holds it's DOM element? I did not find it.

    This link Example/Tutorial - interactive area in the pano (aligned distorted hotspot) explains how to get only original hotspot width/height.

    Could anybody help with this?

    Einmal editiert, zuletzt von cvisto (22. November 2016 um 17:50)

  • I found something.

    I changed hotspot.renderer to 'css3d'. And now I can get DOM element. But its displayed size is changed because of css "transform: perspective(Npx) translateZ(Npx)" property.

    I think I had to explain the issue from the very beginning.

    There is a distorted image hotspot wich is placed in the bottom of the screen. Every time onviewchange event is fired pixels coordinates of screen are translated by screentosphere function and atv/ath of the hotspot are changed. So hotspot stays at the same place. Also hotspot is rotated around bottom edge with rx/rz properties (in onviewchange event handler).

    There is another NOT distorted text hotspot that is needed to be at the top edge of previous hotspot.

    I decided to calculate position of text hotspot using trigonometry functions. And that works when displayed size and original size of hotspot are the same


    But when fov is changed it does not help.




    That's why I tried to find image hotspot size according to FOV value.


    Maybe there is another solution of this issue? Any ideas?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!