Add static lables that fade in/out at the edge of view

  • Hi guys
    I'd like to add static labels to a panorama, that would fade in when coming into view, and fade out when about to go out of view.
    For example I have a scene with a public park. In front of me is a bench, and behind me is a swing. I want to label both those items. Then when I turn to see the swing, naturally the bench would go out of view since its behind me, so I want it's label to fade out as I turn away from it. As the swing comes into view, it's label should fade in.
    How can I achieve something like that?

  • Just before it goes out of view
    So if you rotate clockwise, then new things come in from the right - they should fade in. Then as the move over to the left (because you are still rotating clockwise), it should fade out again as it gets near the left edge of the screen.

    So no it should not fade out when not in view (that would have no point since you cant see it anyway). It should fade out just before it goes out of view.

    If you then change rotation direction, things should fade in from the left and fade out from the right.
    So if you can imagine a safeframe like in HD frame terms, in the center of the image, labels and hotspots etc are visible, but as soon as it goes out of the safeframe, it should fade out

    Makes better sense now?

  • you'd have to use the viewchanged event and all the time calculate if a hotspot is outside the safe/ visible zone
    you dont tween, you set the opacity according to the position

    in the loop process all hotspots (maybe tag the ones which should be affected)
    use the spheretoscreen action to translate their ath/atv to screen coords
    with the coords it is easy to define a border width and set the opacity

    its highly recommended to do this as a js-action for speed.

    shouldnt be to hard, but better forget to support vr mode, that gets complicated...

Jetzt mitmachen!

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