spheretoscreen for hotspots outside the viewport

  • Hi!

    I'm trying to overlay hotspots with html elements and make them stick to edges of the screen when they are outside of the viewport.

    For hotspots outside of the viewport I'm not getting values returned by using spheretoscreen. Is this is anyway possible? Maybe with a workaround.

    Im using the following little snippet;

    Code
    <events onviewchanged="		spheretoscreen(hotspot[camera-crowd1].ath, hotspot[camera-crowd1].atv, hotspotcenterx, hotspotcentery);"/>
  • Hello there,

    I am trying to do something similar to this, although I do understand the mathematical limitations, so I only need to know when hotspots are outside of the FOV but still in the projection plane, hence "close" to being displayed.

    Although I think there's another problem... I am doing what the original poster was:

    spheretoscreen(get(hotspot[trackinghtsp_1].ath), get(hotspot[trackinghtsp_1].atv), hotspotPosX, hotspotPosY);

    and the values for hotspotPosX and hotspotPosY always refer to the same spot on the FOV: the center of the video. I move the camera around, and the values accomodate to show that point, not the hostpots ath and atv...

    I am tracing as well the hostpots values before using spheretoscreen and they do change without moving the camera, so they are correct...

    I'm just starting to learn the ropes, so hopefully I didn't just get the syntax wrong!

    Am I doing something wrong? Any ideas?

  • Ah, got it, it was a matter of sending variables without the "get" method... so this worked:

    spheretoscreen(hotspot[trackinghtsp_1].ath, hotspot[trackinghtsp_1].atv, hotspotPosX, hotspotPosY);

    *whistling*

Jetzt mitmachen!

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