I just updated to three.js r72 and I am getting the following warning in console concerning THREE.LinePieces ...
THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.
The lines will appear disconnected dispite the warnings, however, for the following example, if I update THREE.LinePieces to THREE.LineSegments all disconnected lines become connected.
var lineMaterial = new THREE.LineBasicMaterial({color: 0x000000, linewidth: 1});
var lineGeom = new THREE.Geometry();
var xstrt = 0;
for (nn=0; nn<numLines; nn++)
{
lineGeom.vertices.push(new THREE.Vector3(xstrt, -5, 0));
lineGeom.vertices.push(new THREE.Vector3(xstrt, 5, 0));
xstrt += 5;
}
var Line = new THREE.Line(lineGeom, lineMaterial, THREE.LinePieces); // seperate lines, but with warnings
//var Line = new THREE.Line(lineGeom, lineMaterial, THREE.LineSegments); // connected as one line only :(
Am I expected to create separate geometries (containing two vertices) for each line segment or is it possible to merge multiple line segments into one geometry as I had with LinePieces?
Here is the pattern to follow to create a collection of line segments with a single draw call.
var line = new THREE.LineSegments( geometry, material );
three.js r.72
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With