How to embed image in HTMLMesh?


I’m trying to embed an HTML containing some text and image into an HTML Mesh and adding it to a scene. So far, adding text is possible but for some reason, the image doesn’t show up. Does HTML Mesh support image + text embeds?

Here is a small demo link to my sample:

Thank You!

Doesn’t seem like, the implementation seems to be a light version of html2canvas, basically replicating what is rendered in a dom on a canvas. You could add handling images to the code, but you would have to implement it’s different rendering modes too such as fit, cover, repeat depending on what you need.

Other than that you may look for mixing CSS3D renderer with WebGLRenderer, since you can use invisible planes to punch pixel-correct holes in the WebGL canvas so the CSS3D parts are shown like being in the scene.

1 Like

Do you know if the CSS3D method will work in WebXR VR mode? I need to use this in a VR scenario.

It won’t, in that case you need an alternative such as HTMLMesh.