o1s*_*und 7 javascript three.js
我刚刚更新到three.js r72,我在控制台中收到了关于THREE.LinePieces的以下警告......
THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.
Run Code Online (Sandbox Code Playgroud)
这些行将显示为断开连接,并显示警告,但是,对于以下示例,如果我将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, lineMaterial, THREE.LineSegments); // connected as one line only :(
Run Code Online (Sandbox Code Playgroud)
我是否希望为每个线段创建单独的几何图形(包含两个顶点),或者可以将多个线段合并为一个几何图形,就像我使用LinePieces一样?
Wes*_*ley 12
下面是使用单个绘制调用创建线段集合的模式.
var line = new THREE.LineSegments( geometry, material );
Run Code Online (Sandbox Code Playgroud)
three.js r.72
| 归档时间: |
|
| 查看次数: |
3235 次 |
| 最近记录: |