Posts: 6,326
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
22-11-2021, 01:20 PM
(This post was last modified: 22-11-2021, 01:30 PM by josemendez.)
(22-11-2021, 01:09 PM)Romahaaa Wrote: Well, I checked all you sample scenes and watched the videos and seems still need you help, because I can't get how can I setup the bending setup I need.
Here is the examplehttps://take.ms/jV44S - the dollar should bend along the X axis similar to red lines shapes. As I said before, Y axis should be constant.
I created the model and here is it's blueprint.
I couldn't make the result I need using any of the tutorial you provided. Should I create some custom tethering groups to each particle?
That topology will allow the note to only bend in one axis (there's no geometry to bend in any other axis, so it's geometrically impossible for it to bend any other way). You mention the results aren't what you wanted, what results did you get instead?
From the screenshots it just looks like the cloth has zero max bending. Did you adjust bend constraints?
(22-11-2021, 01:09 PM)Romahaaa Wrote: I don't even say a word about how would it be possible to "pick" the note at exact point while I don't have any vertex in the mesh in the middle of the bank note.
Just use surface collisions and queries. This allows you to query any point on the surface of the note, regardless of the amount of vertices in the mesh (see the ClothRaycast sample scene, for instance)
Posts: 40
Threads: 8
Joined: Nov 2021
Reputation:
2
24-11-2021, 01:02 PM
(This post was last modified: 24-11-2021, 01:43 PM by Romahaaa.)
(22-11-2021, 01:20 PM)josemendez Wrote: From the screenshots it just looks like the cloth has zero max bending. Did you adjust bend constraints?
Finally made it bend, but the result looks like a plastic plane ( video), not a bank note. Playing with the parameters didn't get result similar to paper. Any advice here?
Quote:Just use surface collisions and queries. This allows you to query any point on the surface of the note, regardless of the amount of vertices in the mesh (see the ClothRaycast sample scene, for instance)
Ok, so I got this point on the bank note surface, but this point is pretty far ( screenshot) from the actual particle positions. How can I apply the movement to the bank note? Checking ObiParticleDragger I see that it apply force to the single particle, but it's not always will be correct. Is there an east way to find the opposite particle and add force to both of them?
Posts: 6,326
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
24-11-2021, 01:31 PM
(This post was last modified: 24-11-2021, 01:32 PM by josemendez.)
(24-11-2021, 01:02 PM)Romahaaa Wrote: Ok, so I got this point on the bank note surface, but this point is pretty far (screenshot) from the actual particle positions. How can I apply the movement to the bank note? Checking ObiParticleDragger I see that it apply force to the single particle, but it's not always will be correct. Is there an east way to find the opposite particle and add force to both of them?
When you use surface collisions, the contact information given by raycast queries includes the index of the simplex hit. (if you're unsure of what a simplex is, check the surface collisions page)
The simplex in the case of cloth is a triangle, and it contains the 3 indices of the particles in it. See the examples in the queries manual page, specifically the single raycast one. Pasting it here for convenience:
Code: // perform a raycast, check if it hit anything:
if (solver.Raycast(new Ray(Vector3.zero, Vector3.up), out QueryResult result, filter, 50, 0.1f))
{
// get the start and size of the simplex that was hit:
int simplexStart = solver.simplexCounts.GetSimplexStartAndSize(result.simplexIndex, out int simplexSize);
// Debug draw the simplex:
for (int i = 0; i < simplexSize; ++i)
{
int particleIndex = solver.simplices[simplexStart + i];
Vector3 pos = solver.transform.TransformPoint(solver.positions[particleIndex]);
Debug.DrawRay(pos, Vector3.up, Color.yellow);
}
}
As you see, the code casts a ray and as a result you get the index of the simplex and the size of the simplex (for cloth is always 3, since it's made of triangles). Then the code iterates trough the simplices to draw them.
Having the simplex, then you can do one of several things: move all 3 particles in it, or use barycentric coordinates to apply different forces to each one, depending on the kind of interaction you're after.
Let me know if you need further help .
Posts: 40
Threads: 8
Joined: Nov 2021
Reputation:
2
(24-11-2021, 01:31 PM)josemendez Wrote: Let me know if you need further help .
Thanks, much more clear now.
Probably the last thing to clarify is about cloth settings to make it more similar to paper, not a plastic material. Please check the "video" url in my previous comment I updated after your last answer
Posts: 6,326
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
24-11-2021, 02:02 PM
(This post was last modified: 24-11-2021, 02:07 PM by josemendez.)
(24-11-2021, 01:45 PM)Romahaaa Wrote: Thanks, much more clear now.
Probably the last thing to clarify is about cloth settings to make it more similar to paper, not a plastic material. Please check the "video" url in my previous comment I updated after your last answer
First thing I can notice (correct me if I'm wrong in assuming this!) is that the note seems very large compared to a real note. Physics engines in general - Obi in particular - use real world magnitudes for everything: distances, masses, velocities, accelerations, etc. Unity units are meters, so it would seem your note is at least 1 meter long.
The scale of things plays a huge role in physical behavior: A 10x10x10 cube seen from ten meters apart would appear to fall much more slowly and have less "snappy" movement than a 0.1x0.1x0.1 cube seen up close, despite visually looking identical. In your video the note behaves like a cardboard piece of around 1-2 meters long, which is probably what a real bank note of that size would look like.
So first step imho would be to make the note roughly the same size of a real note, to get "external" behavior (gravity, collisions, etc) right.
Then, the difference in internal dynamics between cloth and paper are very subtle, so it's quite difficult to capture them in a particle based simulation. Probably increasing bend constraint plasticity a bit and increasing solver damping would get it closer to paper-like behavior.
Let me know if you need guidance on this. cheers!
Posts: 40
Threads: 8
Joined: Nov 2021
Reputation:
2
29-11-2021, 01:31 PM
(This post was last modified: 29-11-2021, 02:26 PM by Romahaaa.)
(24-11-2021, 02:02 PM)josemendez Wrote: First thing I can notice (correct me if I'm wrong in assuming this!) is that the note seems very large compared to a real note. Physics engines in general - Obi in particular - use real world magnitudes for everything: distances, masses, velocities, accelerations, etc. Unity units are meters, so it would seem your note is at least 1 meter long.
Yes, you were right regarding the banknote world size, it was multiplied by 10.
I fixed that changing model import scale and regenerated blueprint. Now the result looks unrealistic at all - old version with x10 scale simulated paper much better.
Setting bending to minimal value in any case make it look like a simple cloth ( screenshot)
Playing with my scene looks like Obi Cloth is not able to do what I actually needed. It's my fault I didn't describe all the parts of my simulation. Please have a look here.
If it's not possible seems I need to use some mesh bending tool for this task.
Posts: 6,326
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
29-11-2021, 02:24 PM
(This post was last modified: 29-11-2021, 02:27 PM by josemendez.)
Quote:Now the result looks unrealistic at all - old version with x10 scale simulated paper much better.
What do you mean *exactly* by it simulated paper better? What is off exactly now? bending, damping, aerodynamics...? Can you share a video of its current behavior?
Did you try increasing bend plasticity as suggested?
Paper usually has quite pronounced plastic behavior, cloth does not. This means that when you bend/fold paper, it "remembers" the fold and it becomes its new rest shape. Cloth on the other hand is usually a lot less plastic, some fabrics have close to zero plasticity (silk for instance).
Quote:Setting bending to minimal value in any case make it look like a simple cloth (screenshot)
That looks like bending is set to a very high value, not the minimum (zero). Are bend constraints even enabled in the solver? Make sure they are, and that the relaxation factor is set to 1 (100%).
Posts: 40
Threads: 8
Joined: Nov 2021
Reputation:
2
29-11-2021, 03:15 PM
(This post was last modified: 29-11-2021, 03:35 PM by Romahaaa.)
(29-11-2021, 02:24 PM)josemendez Wrote: Did you try increasing bend plasticity as suggested? Sure I did. I played with many parameters, and didn't get any even more or less suitable result.
Quote:Can you share a video of its current behavior?
Nothing to record there - the banknote just falls to the bottom plank, and the result is shown in the screenshot.
Quote:That looks like bending is set to a very high value, not the minimum (zero). Are bend constraints even enabled in the solver? Make sure they are, and that the relaxation factor is set to 1 (100%).
You can see on the screenshot all values are set to 0. And yes, I played with a plasticity parameters as well, as I mentioned above.
Quote:That looks like bending is set to a very high value, not the minimum (zero). Are bend constraints even enabled in the solver? Make sure they are, and that the relaxation factor is set to 1 (100%).
As a base I took ClothStaticMeshCollider scene. Yes, bend constraints enabled and relaxation is 1
Duplicating part of my last message as I assume it was missed.
Quote:Playing with my scene looks like Obi Cloth is not able to do what I actually needed. It's my fault I didn't describe all the parts of my simulation. Please have a look here.
If it's not possible seems I need to use some mesh bending tool for this task.
Posts: 6,326
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(29-11-2021, 03:15 PM)Romahaaa Wrote: Sure I did. I played with many parameters, and didn't get any even more or less suitable result.
Nothing to record there - the banknote just falls to the bottom plank, and the result is shown in the screenshot.
You can see on the screenshot all values are set to 0. And yes, I played with a plasticity parameters as well, as I mentioned above.
As a base I took ClothStaticMeshCollider scene. Yes, bend constraints enabled and relaxation is 1
Duplicating part of my last message as I assume it was missed.
Ok! Will try to reproduce a good paper-like behavior and share the results with you.
Posts: 40
Threads: 8
Joined: Nov 2021
Reputation:
2
Thanks a lot. I believe "Paper" sample scene in the Obi Cloth package may help to some others as well
|