合并平面只能渲染第一个平面,我正在尝试将平面合并在一起以保存性能,因为我计划一次渲染至少4096个并且我只想为它们进行一次绘制调用。 / p>
我正在使用Three.js r70
mapGeo = new THREE.Geometry();
for (var y = 0; y < 10; y++) {
for (var x = 0; x < 10; x++) {
for (var z = 0; z < 1; z++) {
plane = new THREE.Mesh(new THREE.PlaneGeometry( 1, 1));
plane.position.y = y;
plane.position.x = x;
plane.position.z = z;
mapGeo.merge(plane.geometry, plane.matrix);
}
}
}
map = new THREE.Mesh(mapGeo, new THREE.MeshFaceMaterial(materials))
scene.add(map);
答案 0 :(得分:2)
我明白了!
您必须在合并几何图形
之前更新矩阵plane.updateMatrix();
mapGeo.merge(plane.geometry, plane.matrix);