我刚刚更新到three.js r72,我在控制台中收到了关于THREE.LinePieces的以下警告……
THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.
这些行将显示为断开连接,并显示警告,但是,对于以下示例,如果我将THREE.LinePieces更新为THREE.LineSegments,则所有断开的行都将连接.
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,THREE.LineSegments); // connected as one line only :(
我是否希望为每个线段创建单独的几何图形(包含两个顶点),或者可以将多个线段合并为一个几何图形,就像我使用LinePieces一样?