Tengo un objeto básico THREE.js TextGeometry en mi escena:
const loader = new THREE.FontLoader(); const linkToFont ='link-to-font'; let textGeo; const self = this; loader.load(linkToFont, function (font) { textGeo = new THREE.TextGeometry('Hello three.js!', { font, size: 0.3, height: 0.01, }); textGeo.computeBoundingBox(); const textMaterial = new THREE.MeshBasicMaterial({ color: 0xff0000 }); const textMesh = new THREE.Mesh(textGeo, textMaterial); textMesh.position.set(-100, 0, 0); textMesh.updateMatrixWorld(); self.addToScene(textMesh); });Esto muestra el texto en rojo en mi escena. ¿Es posible dar al texto en esta área un "color de fondo"? ¿Es decir, un color sólido rectangular detrás del texto mismo?
Tienes 2 opciones:
scene.background = new THREE.Color(0x9900ff) .MeshBasicMaterial .