我试过这个:
var fontLoader = new THREE.FontLoader();
fontLoader.load("/assets/fonts/helvetiker_bold.typeface.json",function(font){
var text2D = new THREE.TextGeometry(newText.textContent, {
size: 200,
height: 2,
curveSegments: 3,
font: font
});
var color = new THREE.Color( newText.color );
var textMaterial = new THREE.MeshBasicMaterial({ color: color });
var text = new THREE.Mesh(text2D , textMaterial);
text.name = "2D Text 1";
//Add the text to current scene
current_scene.add(text);
//set the elemnt as active element
activeElement = current_scene.getObjectByName(text.name);
console.log('activeElement:',activeElement);
});
function textData(changedValue){
activeElement.geometry.parameters.text = changedValue;
}
Run Code Online (Sandbox Code Playgroud)
但我没有得到任何改变。这是正确的方法吗?或者需要矩阵参数的任何更新?
three.js ×1