0
votes

We're recomputing the vertices and the faces on a manually generated object. The first version of the object gets displayed fine, but after recalculation some of the faces are not displayed. Also, __tmpVertices on geometry seems to be wrong. We've tried tons of functions which are supposed to update the mesh, but we haven't figured out a working solution yet.

The two things we update on the geometry is geometry.vertices, geometry.faces and geometry.faceVertexUvs, nothing else. Afterwards we call these 4 methods:

geometry.mergeVertices();
geometry.computeVertexNormals();
geometry.computeCentroids();
geometry.computeFaceNormals();

unfortunately, without success: part of the new faces are not displayed, it actually seems like it displays just the amount of faces the previous object had, and not more.

We would definitely appreciate some help in this matter!

Kind regards Roman and Patrick

1
Try this order: mergeVertices, centroids, faceNormals, vertexNormalsWestLangley
No luck, unfortunately. Right now it's the following order: - generate geometry.vertices - generate geometry.faces - geometry.mergeVertices(); - geometry.computeCentroids(); - geometry.computeFaceNormals(); - geometry.computeVertexNormals(); Still part of the faces are not displayedDoidel
Are they displayed if you set material.side = THREE.DoubleSide? If not, can you provide a simple live example (jsfiddle.net) to demonstrate your issue?WestLangley
Hello WestLangley. We've uploaded a work in progress here: link. After 2 seconds the mesh is recalculated and displayed, and the error appears. We already had it DoubleSided, changing it has no effectDoidel
Sorry, I can't debug your code for you. You look like you are making good progress. Don't give up.WestLangley

1 Answers

1
votes

According to a previous post on stackoverflow (Dynamically Adding Vertices to a Line in Three.js) changing the size of the content buffers is not supported. Therefore we'll just recreate the object itself when trying to change the amount of vertices/faces.