【发布时间】:2012-02-10 03:32:13
【问题描述】:
我用 three.js 制作了一个图表,我想用 THREE.Line 连接节点。 在我用鼠标移动其中一个节点后,必须用节点的新坐标重新创建边缘(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);
}
非常感谢您的任何建议!
【问题讨论】: