Is it possible to get width and height of a hotspot if those attributes are NOT set

  • I have some image and video hotspots that I am using as image and video popups in VR Devices. It looks like the following (a video popup):


    Here I want to place a close button top-center but the problem is that I am not able to position the close button based on height of the popup as I am not setting any explicit width/height for popup, it has to be based on the image/video original size.

    My question is, is it possible to get native width/height/bounding-rectangle of a hotspot to calculate the position of the close button like ath + height/2 or so?

    Any other idea to solve this close button position is also obviously a great help. I saw that layers or parent-child has issues in VR thats why I am trying flat / single level of hotspots.

    This is the code I use to add close button: hotspot[popup] is the video/image popup shown in above image


    Peace,

  • Hi,
    If you install the video (picture) by ath atv, then I do not advise you to touch the parameters tx ty tz. Work in one coordinate system.
    If in spherical then try this code:

    Code
    copy(popup, hotspot[popup]);
    addhotspot('popup_close', pc);
    set(pc, url='https://..../close.png', distorted=true, alpha=0, edge=bottom, onclick=removepopuphotspot() ); 
    calc(pc.ox, popup.pixelwidth / 2 - 5 );  		    
    calc(pc.oy, - (popup.pixelheight / 2 - 5 ) ); 
    copy(pc.ath, popup.ath);
    copy(pc.atv, popup.atv); 
    tween(pc.alpha, 1, 2);


    -5 - is the offset of the hotspot from the top right corner.

    For Cartesian coordinates, another principle of calculation

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!