I know it’s possible to map images to the 6 different sides of a Cube, but how do you map text (either single characters or full words) to each side of a Cube?
I’m trying to do this using a combination of THREE.TextGeometry and map - but is it even possible to map a TextGeometry? Or do I need a different approach, like making an actual Mesh from each of the text-words, then somehow mapping that mesh onto the Cube’s mesh?
I made a fiddle here - it works with the images, but it looks like the fontLoader - on line 49 - isn’t working:
@hofk Thank you for that link - it’s somewhat helpful in that it’s showing you can do this using a THREE.Group() - but how do you know the coordinates and angles of each side of the Cube so you can properly add a text-mesh to each size correctly?
And what happens if you change the size or angle of the Cube?
This is why I asked about using map, because it always automatically adjusts things for you - so for example if you change the Cube’s size, map would still work cause it would know how and where to place all your additional text textures or meshes - know what I mean?
@hofk You’re right, there are 2 examples in Step 11 - but the 2nd. one uses Canvas which gives you totally flat text - and what I’m looking for is nice, 3D text where you can really change the thickness and bevel of the letters - y’know, get all those wonderful qualities that makes us want to use real 3D in the first place - like the image I attached.
I think I figured it out: I’ll just set the (X, Y, Z) coords of each Text-Mesh so that it lines up with each face of the Cube.
I’m gonna try it out and chime back in…
this is using drei/Decal + drei/RenderTexture. the contents are interactive, they receive pointer events, you can also nest (in that demo the decals dodecahedron itself has a decal)
@drcmda Wow this is exactly what I need! Thanks! Although I’ve been playing around with it for hours and can’t seem to make it work with a box geometry. I’d be really grateful if you could help me out here
Raycaster returns uv. Subtract 0.5, multiply with 2, use these coords for raycaster again for the nested scene’s camera. That’s all. Not that elegant, like in React, but not impossible.
yes, it’s using uv. what makes it a little special is composition. you can take the whole scene and add it into yet another render texture ad infinitum and you still have events within events within events. not impossible, but in a generic, re-usable way, wouldn’t know how tbh. it’s a rare use case though.