Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 349
ngokevin Avatar asked Mar 13 '23 18:03

ngokevin


1 Answers

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:

  • HTML Texture Component
  • Draw Component
  • DOM to Screenshot
like image 199
ngokevin Avatar answered Mar 25 '23 02:03

ngokevin