シーンに追加されたメッシュにジオメトリがマージされています。私は、メッシュ内のマージドジオメトリを更新し、シーンに追加します。これはある間隔です。three.js - マージジオメトリは更新をレンダリングしません
scene.remove(that.graph[i]);
that.graph[i].geometry.dispose();
var planeMaterial = new THREE.MeshLambertMaterial({
color: 0xffffff,
vertexColors: THREE.VertexColors
});
var boxGeometry = new THREE.BoxGeometry(50, 50, Math.random() * 10000, 1, 1);
var cube = new THREE.Mesh(boxGeometry, planeMaterial);
cube.material.color = new THREE.Color(1,0,0);
cube.updateMatrix();
that.graph[i].geometry.dynamic = true;
that.graph[i].geometry.merge(cube.geometry, cube.matrix);
that.graph[i].geometry.mergeVertices();
that.graph[i].geometry.verticesNeedUpdate = true;
that.graph[i].geometry.elementsNeedUpdate = true;
that.graph[i].geometry.morphTargetsNeedUpdate = true;
that.graph[i].geometry.uvsNeedUpdate = true;
that.graph[i].geometry.normalsNeedUpdate = true;
that.graph[i].geometry.colorsNeedUpdate = true;
that.graph[i].geometry.tangentsNeedUpdate = true;
that.graph[i].geometry.groupsNeedUpdate = true;
scene.add(that.graph[i]);
私は更新フラグのほとんどを必要としないことを知っているが、私はすべてを追加したことを示したかったです。
ジオメトリは更新されていますが、最初のレンダリング後はレンダリングされません。
これまでレンダリングできる唯一の方法は、メッシュがシーンに追加される前に以下を追加することです。
that.graph[i].geometry = that.graph[i].geometry.clone();
しかし、これにより、約5回の反復後にタブがクラッシュします。
メッシュが新しいジオメトリで更新されないのはなぜですか?