I am attempting to insert lines between animated sprites, similar to the example provided. Despite trying various solutions, I have been unsuccessful in creating either a dynamic or static line between these animated sprites. Is it feasible to generate a dynamic line connecting the sprites from the aforementioned example? If so, what steps do I need to take?
This is the code snippet that I have been using:
for ( var i = 0; i < objects.length; i ++ ) {
var geometry = new THREE.Geometry();
geometry.vertices.push(objects.position);
var material = new THREE.LineBasicMaterial( {
color: 0x0000FF,
transparent: true,
opacity: 1
} );
var line = new THREE.Line( geometry, material, THREE.LinePieces );
scene.add( line );
}
You can view an attempt at achieving this on ...jsfiddle.net/LxpmN/40/, but note that meshes were utilized instead of sprites in that scenario. I understand the necessity for utilizing
line.geometry.verticesNeedUpdate = true;
, yet I am still unable to even create a static line between objects, as depicted in the previous example.