title: Drawing a line between moving objects
body: <p>I'm trying to draw a line between two moving vertices. The vertex's drawing is stored in a variable called <code>object</code>, which has a <code>position</code>, which is a <code>THREE.Vector3</code>.</p>
  
  <p>The line is created thusly:</p>
  
  <pre><code>var Line = function(scene, source, target){
    var geometry = new THREE.Geometry();
    geometry.dynamic = true;
    geometry.vertices.push(source.object.position);
    geometry.vertices.push(target.object.position);
    geometry.verticesNeedUpdate = true;
  
    var material = new THREE.LineBasicMaterial({ color: 0x000000 });
    var line = new THREE.Line( geometry, material );
  
    scene.add(line);
    return line;
  };
  </code></pre>
  
  <p>..., where source and target are vertices and the vertices get updated via:</p>
  
  <pre><code>vertex.object.position.add(vertex.velocity);
  </code></pre>
  
  <p>Now, I assigned the <code>source.object.position</code> and <code>target.object.position</code> to the <code>line.geometry.vertices[0]</code> and <code>line.geometry.vertices[1]</code> because I wanted one to update with the other. But instead, the vertex positions vary wildly from the line positions. The vertices are where they are, but the lines don't connect to the vertices.</p>
  
  <p>How can I make the lines move with the vertices?</p>