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);
}
非常感謝任何建議!