小程序three真机渲染文字不显示,开发工具上没问题,什么原因?
立方体等都可以显示,真机文字未渲染出来,开发工具是正常的~~
官网demo代码中加入以下代码
//文字
loader = new THREE.FontLoader();
textMesh = new THREE.Mesh();
createTypo = font => {
const word = "Javascript";
const typoProperties = {
font: font,
size: 30,
height: 6,
type: "str",
curveSegments: 1,
bevelEnabled: true,
bevelThickness: 1,
bevelSize: 1,
bevelOffset: 1,
bevelSegments: 20
};
const material = new THREE.MeshNormalMaterial();
const text = new THREE.TextGeometry(word, typoProperties);
textMesh.geometry = text;
textMesh.material = material;
textMesh.position.set(-100, 0, 0);
scene.add(textMesh);
};
//******.json 是一个字体文件
loader.load("******.json", createTypo);
开发工具正常~·
真机预览就不显示了~~·