三维文本

三维文本

在 Three. js H 中渲染文本非常简单。你所要做的只是指定想用的字体,以及基本的拉伸属性。

内置文本

const options = {
  size: controls.size,
  height: controls.height,
  weight: controls.weight,
  font: controls.font,
  bevelThickness: controls.bevelThickness,
  bevelSize: controls.bevelSize,
  bevelSegments: controls.bevelSegments,
  bevelEnabled: controls.bevelEnabled,
  curveSegments: controls.curveSegments,
  steps: controls.steps,
};

console.log(THREE.FontUtils.faces);

text1 = createMesh(new THREE.TextGeometry("Learning", options));
text1.position.z = -100;
text1.position.y = 100;
scene.add(text1);

text2 = createMesh(new THREE.TextGeometry("Three.js", options));
scene.add(text2);

自定义字体

上一页