I have a Three.js scene set up in a git repository on my computer, which I run with a local python server in the mac terminal when I'm developing it, before pushing it to my github repository. As of now, my github repository code is identical to my local code. However, when I run the scene locally I see the TextGeometry objects I added just fine, but when I look at the same code on my github pages site, the TextGeometries do not show up (yet everything else works fine).
I've already looked at this post but it wasn't any help: Javascript: Three.js JSON error on remote server, but not on local
Image of locally running scene with TextGeometry working
Image of remote github pages scene with TextGeometry NOT working
Here is my code for the TextGeometry
/* NUMBER LABELS
* Adds a corresponding number (textGeometry) above each icosahedron
*/
var loader = new THREE.FontLoader();
loader.load( ' ../node_modules/three/examples/fonts/gentilis_regular.typeface.json ', function ( font ) {
// Creates a TextGeometry mesh for each icosahedron mesh and translates it relative to that icosahedron mesh
for (var i = 0; i < icosaMeshes.length; i++){
var numberText = i + 1;
var textGeom = new THREE.TextGeometry( numberText, {
font: font,
size: 10,
height: 1,
curveSegments: 12,
bevelEnabled: false,
bevelThickness: 10,
bevelSize: 8,
bevelSegments: 5
});
var textMesh = new THREE.Mesh(textGeom, new THREE.MeshBasicMaterial( { color: 0x000000 }));
scene.add(textMesh);
// Position each number above its respective icosahedron and then translate it up by 50
textMesh.position.setFromMatrixPosition(icosaMeshes[i].matrix);
textMesh.translateY(50);
}
});