I am facing an issue where I want to return multiple lines, but only the first line is being returned. I attempted to create a function specifically for returning the line, but encountered errors because I couldn't figure out where to place it.
Does anyone have suggestions on how to accomplish this task successfully?
for (var i = 0; i < testArray.length; i +=3) {
geometry.vertices.push(
new THREE.Vector3( testArray[i], testArray[i + 1], testArray[i + 2] ),
new THREE.Vector3( testArray[i + 3], testArray[i + 4], testArray[i + 5] ));
var line = new THREE.Line(geometry, material);
return line;
// alternatively, if using a function, call returnLine(line);
}
Here is the attempt at creating a function:
function returnLine(line) {
return line;
}