I’m trying to output the text. Here is the call of the object to which the text is attached :
const earthGeometry1 = new THREE.SphereGeometry( 0, 0, 0 );
const earthMaterial1=0;
earth1 = new THREE.Mesh( earthGeometry1, earthMaterial1 );
scene.add( earth1 );
Then the text :
const earthDiv1 = document.createElement( 'div' );
earthDiv1.className = 'label';
earthDiv1.textContent = 'Earth';
earthDiv1.style.backgroundColor = 'transparent';
const earthLabel1 = new CSS2DObject( earthDiv );
earthLabel1.position.set( 1.5 * EARTH_RADIUS, 0, 0 );
earthLabel1.center.set( 0, 1 );
earth1.add( earthLabel1 );
earthLabel.layers.set( 0 );
const earthMassDiv1 = document.createElement( 'div' );
earthMassDiv1.className = 'label';
earthMassDiv1.textContent = '5.97237e24 kg';
earthMassDiv1.style.backgroundColor = 'transparent';
const earthMassLabel1 = new CSS2DObject( earthMassDiv );
earthMassLabel1.position.set( 1.5 * EARTH_RADIUS, 0, 0 );
earthMassLabel1.center.set( 0, 0 );
earth1.add( earthMassLabel1 );
earthMassLabel1.layers.set( 1 );
Run all code here :