Closed merco closed 1 month ago
Hello, use below ComputeNormalsGroup function after loading obj file
public void ComputeNormalsGroup(Group group) { group.Traverse(o => { if (o is Mesh) { var tempGeom = new Geometry(); (o.Geometry as BufferGeometry).deleteAttribute("normal"); tempGeom.FromBufferGeometry((BufferGeometry)o.Geometry); tempGeom.MergeVertices(); tempGeom.ComputeVertexNormals(); tempGeom.NormalsNeedUpdate = true; o.Geometry = tempGeom; } }); } ...
OBJLoader loader = new OBJLoader(); var rootObject =loader.Load("../../../../assets/models/obj/O{22}.obj"); ComputeNormalsGroup(rootObject);
you can refer to https://discourse.threejs.org/t/how-to-smooth-an-obj-with-threejs/3950
ok. But how can I convert back it to BufferGeometry?
Now I have this problem with raycast
now the objects are really soft!! maybe too much :)
you can convert to BufferGeometry like as below
//o.Geometry = tempGeom;
(o.Geometry as BufferGeometry).FromGeometry(tempGeom);
What determines this better visualization? Normals?
O{15}.zip
O{22}.zip