Search code examples
javascriptwebglwebvraframe

How can I render HTML in A-Frame?


How can I render or display plain HTML markup as a texture in A-Frame?

I want to do something like:

<!-- language-all: lang-html -->
<a-scene>
  <div>HELLO WORLD</div>
</a-scene>

Solution

  • To render HTML as a texture in A-Frame, it is not as easy as dropping HTML into <a-scene>.

    Solutions involve painting to a <canvas> and using the canvas as texture onto 3D meshes. The A-Frame community has shared some components for this: