How easy it is to modify the softbody mesh during runtime? - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: How easy it is to modify the softbody mesh during runtime? (/thread-3162.html) |
How easy it is to modify the softbody mesh during runtime? - snowtv - 03-11-2021 Lets say I have two cubes A and B, and I want to cut both A and B in half (the cutting plane is not pre-determined but is based on user input), then join half of A and half of B together. What is the best approach to this kind of scenario? RE: How easy it is to modify the softbody mesh during runtime? - josemendez - 04-11-2021 (03-11-2021, 07:27 PM)snowtv Wrote: Lets say I have two cubes A and B, and I want to cut both A and B in half (the cutting plane is not pre-determined but is based on user input), then join half of A and half of B together. Not trivial at all. Cutting/tearing softbodies is hard, so much that it's still a very active academic research field. Roughly, you could do it this way: - Determine which triangles in the mesh intersect the cutting plane. - Reorganize mesh topology around these triangles (generate new vertices, new triangles, etc), while keeping correct texture coordinates, colors, normals, etc. - Reorganize softbody constraints around the cut: disconnect particles at different sides of the plane, reseed new triangles with particles and create new particles and shape matching clusters where needed. Then, re-bind each chunk to the particles. Unless you're comfortable with math/physics and C# coding, it's not easy, specially in a particle-based engine. Continuum methods like tetrahedral FEM generally make it easier to do this. RE: How easy it is to modify the softbody mesh during runtime? - snowtv - 04-11-2021 (04-11-2021, 08:35 AM)josemendez Wrote: Not trivial at all. Cutting/tearing softbodies is hard, so much that it's still a very active academic research field. Roughly, you could do it this way: So let's say my mesh is pretty high-poly and I don't need to do the generation of new vertices and triangles (I guess I may have to duplicate some vertices and triangles along the cutting plane), what is the best approach with Obi to modify the topology of existing softbody and form new softbody? Since in my scenario, the cuttings won't be too random, my current plan is to just pre-cut the mesh a few times, and using constrains to sew them together at first, then break them apart based on user input, and create new constrains to sew them back to form the new topology. |