Search code examples
webthree.jsaugmented-realityvirtual-reality

WebVR show html content


I'd like to create a virtual space where I want to mix 3D elements and html content. I have seem some demos with WebVR but didn't work for me. WebAR is also an interesting option.

Thanks


Solution

  • Unfortunately, this isn't possible at the moment, because

    • there is no proper way to get your hands on the rastered output of the HTML in order to use it as a texture in WebGL and
    • there is no way to get any html-element shown in a WebVR-context

    There is certainly work being done in both directions, but your best bets would probably be a-frame (https://aframe.io/) or reactVR (https://developer.oculus.com/blog/introducing-the-react-vr-pre-release/) which both at least have a bit of that html-feeling to it and can handle text pretty well (nothing compared to the power of html+css, but they will get there at some point).

    Another option is to use a library like html2canvas (https://html2canvas.hertzen.com/) to get some rendered output from a piece of html which you can then use as a texture. Also has it's limits but might be worth a try...

    Have fun!