//需要网上找ttf格式中文字体,然后转json,不然中文文字就是乱码
initText() {
let loader
= new Three.FontLoader()
loader
.load(this.fileUrl
+ '/gltfl/fbx/text/FZXingHeiS-R-GB_Regular.json', function (font
) {
var geometry
= new Three.TextBufferGeometry("我的", {
font
: font
,
size
: 2,
height
: 0.01,
curveSegments
: 0.01,
bevelEnabled
: true,
bevelThickness
: 0.01,
bevelSize
: 0.01,
})
let textMaterial
= new Three.MeshBasicMaterial({color
: 0xff6600})
let mesh
= new Three.Mesh(geometry
, textMaterial
)
scene
.add(mesh
)
})
},
//转json格式的在线网站 http://gero3.github.io/facetype.js/