1
我用three.js制作一个图形,我想用THREE.Line连接节点。 用鼠标移动其中一个节点后,必须重新创建带有节点新坐标的边(THREE.Line)。我怎么做到的?Three.js重新定义THREE.Line ..等
我的代码不更新的观点:
function render(){
newEdge.vertices.push(new THREE.Vertex(inNode.position));
newEdge.vertices.push(new THREE.Vertex(outNode.position));
var newLine = new THREE.Line(newEdge, new THREE.LineBasicMaterial({
color: 0xff0000,
opacity: 0.9
}));
scene.objects[edgePos] = newLine;
renderer.render(scene, camera);
}
非常感谢任何建议!