Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help on configuring Obi Rope to simulate sewing.
#3
(26-10-2017, 12:38 AM)ploom Wrote: Hello,

Just want to start by saying I really like Obi Rope, it performs excellently and I can see a lot of potential in the platform.

Now for my issue: I am trying to simulate sewing, like thread and needle sewing. I am just having some difficulty with configuring the rope to look and feel like thread (or dental floss). To clarify, currently my Obi Rope is stretchy, bouncy, and too fluid. When I move the needle (with thread pinned to it), I need the thread to have 0 stretch, 0 bounce, and stiff enough that simple movement like up-down or left-right does not make the thread jiggle like a wet noodle. And of course, it should have enough bending that will allow for tying relatively tight knots, but that is less of a priority than the thread movement itself.

What are some options to play around with? Or at least which options should I avoid or disable completely to get rid of stretch, bounce, and spring, and add stiffness?

Thank you very much!

Amen to what niZmo said.

To further explain the situation: All physics simulations are composed of several "parts" or "bodies" (particles in Obi's case) that interact together in some way. These interactions are represented by a set of equations that must be solved exactly or approximately.

Very broadly speaking, there are two kinds of physics solvers: direct and iterative. Direct solvers take all equations (that relate all parts in the simulation) and try to find the exact solution in one go. They are usually fast enough for small scenes (2, 3, 10 equations) but as the amount of equations grow, they can become extremely expensive. To achieve zero stretch, zero bounce, (that is, a perfect simulation) you'd need a direct solver, and these are too slow to be used in realtime.

On the other hand, iterative solvers -Obi, PhysX, Bullet, Box2D, Havok...nearly all game physics engines- do several quick passes (iterations) over all equations, getting closer to the exact solution each time. You can stop the process at any time and get a reasonably good solution. The more times you let the solver iterate, the better the solution (that is, less stretchy rope). These are much faster and you can easily adjust quality/performance. The downside is that they won't get you an exact solution unless you use a lot of iterations (and most of the time, they will still arrive faster at the solution than a direct solver).

So, direct solvers are used in scientific scenarios where accuracy is paramount (seen them used for surgical suture simulators, where all there is in the scene is a single thread). For games, iterative solvers are the way to go. So as niZmo said, it is not possible to get zero stretch in the general case. Not with Obi, not with any other physics engine. There are tricks that you can use for certain scenarios (he mentioned tether constraints), but that's all.

That being said: crank up the amount of distance constraint iterations in ObiSolver to get less stretchy rope. How high you can set the iteration count depends on your performance budget and your tolerance for stretchiness.
Reply


Messages In This Thread
RE: Help on configuring Obi Rope to simulate sewing. - by josemendez - 26-10-2017, 10:02 AM