calculate if hotspot is close to edge

  • Hi,

    I've got some hotspots that have a rollover effect, and when this is close to the edge of the screen this effect happens off screen. I want to adjust the h/vlookat to include the full hotspot without using a looktohotspot.

    Any ideas?

  • Hi,

    sorry, I don't know what you mean...
    ...but you can get the hotspot h/v variables by - hotspot[name].ath - and - hotspt[name].atv - and then calcualte maybe something with the current viewing direction variables - view.hlookat - and - view.vlookat,

    best regards,
    Klaus

  • Hi,

    the hlookat/vlookat is the looking direction to the middle of the screen, it can never at the edge,
    you could calculate the degree coordinations of the left/right screen edges by subtracting and adding the half hfov to the hlookat value,
    e.g.

    Code
    <events onviewchange="test();" />
    
    
    <action name="test">
    	adjusthlookat(0);
    	mul(halfhfov, view.hfov, 0.5);
    	sub(leftedge, view.hlookat, halfhfov);
    	add(rightedge, view.hlookat, halfhfov);
    	trace('current viewing range from ',leftedge,' to ',rightedge);
    </action>

Participate now!

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