Tôi đang sử dụng BA.JS rev 49.Cập nhật hình học bên trong lưới không có gì
Chương trình của tôi cần cập nhật lưới bằng cách thay đổi hình dạng của nó. Thật không may màn hình dường như không cập nhật.
Đây là mã của tôi:
// theObject is an array of associatives :
// {
// object1: {mesh: undefined/THREE.mesh, mat: THREE.Material, geo: THREE.Geometry}
// object2: {mesh: undefined/THREE.mesh, mat: THREE.Material, geo: THREE.Geometry}
// ...
// }
// In my function, theObject[i].mesh geometry must change to be theObject[i].geo.
for(i in theObjects) {
//*
if (theObjects[i].mesh == undefined) {
theObjects[i].mesh = new THREE.Mesh(theObjects[i].geo, theObjects[i].mat);
theObjects[i].mesh.geometry.dynamic = true;
theObjects[i].geo.verticesNeedUpdate = true;
scenePostsurgery.add(theObjects[i].mesh);
} else
theObjects[i].mesh.geometry.vertices = theObjects[i].geo.vertices;
}
Tôi có phải thêm cái gì khác?
/Oragon
Cảm ơn bạn Uhura.Tôi mặc dù 'verticesNeedUpdate' là một tùy chọn vĩnh viễn. :) –