为什么我的three.js线条如此昂贵?

时间:2014-09-29 13:05:47

标签: javascript three.js

function drawEdge(source, target) {
    material = new THREE.LineBasicMaterial({
        color: 0xff0000,
        opacity: 1,
        linewidth: 0.5
    });

    var tmp_geo = new THREE.Geometry();
    tmp_geo.vertices.push(source.data.draw_object.position);
    tmp_geo.vertices.push(target.data.draw_object.position);

    line = new THREE.Line(tmp_geo, material, THREE.LinePieces);
    line.scale.x = line.scale.y = line.scale.z = 1;
    line.originalScale = 1;

    geometries.push(tmp_geo);

    scene.add(line);
}

我在800分上称这次约2000次......我试过"缓存"我将new THREE.LineBasicMaterial置于功能之外,但似乎没有帮助。

我认为将球体作为瓶颈并且我必须转移到粒子系统,但线条正在扼杀我的表现

0 个答案:

没有答案