Hotspot alpha relative to hlookat, onviewchange

  • Hope someone can help!

    I've been scratching my head over this for days. I want to fade in a hotspot (simple label, png image) to fully opaque when it's at the centre of the user viewing direction, and then fade out to zero as they move either left or right. Using the onviewchange event. Ideally, there would be some sort of "factor" involved as a variable, so that if you move say 30 degrees to the left, if fades to zero as you hit 30, and 30 degrees to the right, also zero as you reach 30. Hope this makes sense!


    <events onviewchange="continuous_tracking();" />

    <action name="continuous_tracking">
    if (view.hlookat LT 0,
    calc(labelAlpha, (view.hlookat * -1) / get(hotspot[label-breakout].ath) );
    ,
    calc(labelAlpha, view.hlookat / get(hotspot[label-breakout].ath) );
    );
    trace(labelAlpha);
    set(hotspot[label-breakout].alpha, get(labelAlpha));
    </action>

    Any input greatly appreciated!

    Tim

  • Just try this code

    translation difficulties *huh*

  • Apparently I translated your question incorrectly.

    translation difficulties *huh*

  • I need to reply here to this old post , but I've to ask why the code won't work if I use it with togheter with the "Tooltip" plugin.
    In that case my hotspots remain always invisible, no matter which transparency angle value I insert....

    Someone could please give me some help?Luca

    Einmal editiert, zuletzt von GIOLETS (3. Februar 2023 um 22:53)

Jetzt mitmachen!

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