WorldWideTelescope / wwt-web-client

The WorldWide Telescope web client lets you explore the universe in your browser.
https://worldwidetelescope.org/webclient/
MIT License
105 stars 35 forks source link

Hover text annotations no longer work #219

Open pkgw opened 5 years ago

pkgw commented 5 years ago

It should be possible to create annotations with associated text that appears when the mouse hovers over them:

        var c = wwt_si.createCircle(false);
        c.setCenter(0.0, 0.0);
        c.set_radius(1.0);
        c.set_id("mycircle");
        c.set_label("Hello");
        c.set_showHoverLabel(true);
        wwt_si.addAnnotation(c);

However, this doesn't work anymore because WWTControl.DrawHoverText isn't implemented for the WebGL rendering backend (here).

Fixing this will require some kind of implementation of generic text rendering in WebGL; this set of articles lays out some of the possible approaches.

CC @DougBurke.

astrojonathan commented 5 years ago

We have a text rendering class implemented in WWT and could make use of that for the hover.

pkgw commented 5 years ago

@astrojonathan Do you mean SkyText and related classes? I was wondering: do those have full font coverage? The glyphs1.png file doesn't seem to have all of the letters ...

astrojonathan commented 5 years ago

We can create textures for any font set we want to use. We can also render to an HTML Canvas with HTML5 and capture that as a Texture and use that to render.