Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

302
Vistas
Can you set background color of a Three.js TextGeometry object?

I have a basic THREE.js TextGeometry object in my scene:

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);
});

This renders text in red on my scene. Is it possible to give the text in this area a "background color"? I.e. a rectangular solid color behind the text itself?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have 2 options:

  1. If you want to cover the entire canvas in a single color, use scene.background to cover the whole canvas scene.background = new THREE.Color(0x9900ff).
  2. If you want to limit the area that the background color covers, just create a plane behind the text with the color that you want in the MeshBasicMaterial.
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda