Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!