Is there a way to use 2D text as a (non repeating) texture on a surface? Like a sprite as a name sign for instance. I don’t know the names ahead of time, so can’t pre-generate images for them.
The typical approach for solving this issue is to write the text on a canvas and then use it to create an instance of THREE.CanvasTexture
. This texture can be then used with a THREE.Sprite
.
2 Likes
In the Collection of examples from discourse.threejs.org you will find a simple example. Maybe it is helpful.
See https://hofk.de/main/discourse.threejs/2020/index2020.html
Here is
canvas.width = 1024;
canvas.height = 1024;
very big.
This may also be interesting.
(Collection 2019, Links in Source Code)
https://hofk.de/main/discourse.threejs/2019/3DReducedTextGeometry/3DReducedTextGeometry.html
2 Likes
Awesome. I missed the CanvasTexture. Thanks