# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 7 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Strange behaviour: sphere on a concave meshPosted: Sun Apr 29, 2012 4:02 pm

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
Hi!

I have a path with a concave triangle mesh collision shape (btBvhTriangleMeshShape), and a sphere (btSphereShape) on it. I call addForce on the rigid body of the sphere, in every tick, with a force vector paralell to the surface of the path. Now the path has a simple rectangular shape with many triangles of its top surface. In the future it will have concave shape. So now, the triangles of the surface of the path are coplanar, and are along the XZ plane. So I use addForce to my sphere, my sphere accelerates along the XZ plane (on the ground), and above a specific speed the sphere starts to bounce on the surface, along the vertical (Y) axis too. Small bounces first, but growing after, till I lower the speed. If I replace the btBvhTriangleMeshShape to btConvexHullShape temporarily then the bouncing disappear. If I change steptime from 1/60 to 1/200 the bouncing is less, but not disappear. The combined Friction and combined Restitution are zero both.

Can somebody say what I can do reaching not to start bouncing the sphere above a specific speed ?

Top

 Post subject: Re: Strange behaviour: sphere on a concave meshPosted: Sun Apr 29, 2012 9:36 pm

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
I tried another test:

I created a compound shape of many convex hull shapes from my concave path mesh. And the bouncing was there.

It seems, the only stable version of rolling a ball is when I use one convex shape for the path.

Probably the sphere gets vertical speed rolling at the triangle edges of coplanar triangles,
or the "edges" (borders) of convex hulls in the case of the compound shape of many convex hull shapes.

In both cases the parts of the surface are coplanar, and the adjacent vertex positions are the same. The only problem can be the precision of floats in the vertices, making triangles (or convex hull sides) of the surface of the path not exactly coplanar.

Can it be the problem ? And how can I eliminate it ?

Last edited by openeye on Tue May 01, 2012 12:41 pm, edited 2 times in total.

Top

 Post subject: Re: Strange behaviour: sphere on a concave meshPosted: Mon Apr 30, 2012 6:25 pm

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
I tried another test too:

I made my path with a btBvhTriangleMeshShape again, but I created it from a btTriangleIndexVertexArray istead of the former btTriangleMesh.

After this I call

btGenerateInternalEdgeInfo(pShape,pTriangleInfoMap);

with the btBvhTriangleMeshShape and a newly allocated btTriangleInfoMap.

After this I use

I found this method in the InternalEdgeDemo sample application.

But unfortunately, the bouncing is the same. What can I do to eliminate that bouncing of my sphere ?

I would like my sphere to roll smoothly along the top surface of my path object without the bouncing in the vertical direction.

Top

 Post subject: Re: Strange behaviour: sphere on a concave meshPosted: Tue May 01, 2012 6:36 pm

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
I think that I found the "solution".

I hope there will be somebody who understand this and can explain why this is the situation:

So, the source of the bouncing is the internal edges of my concave mesh collision shape.

There is already a utility solution for this kind of problem in bullet, called "InternalEdgeUtility", and a demo sample called "InternalEdgeDemo".

I used this solution to my program, but this did not solve the bouncing in my situation.

This was because of the friction.

I use a big friction in my program, but the InternalEdgeDemo uses zero friction.

I configure the InternalEdgeDemo to a similar setup like my program. This setup is a bigger an longer, more dense grid, and a sphere collision shape on it, instead of those ones in the original InternalEdgeDemo.

If you download the modified InternalEdgeDemo from the attachment and compile and run it, press space to restart animation, press O for side view, and watch, that if you set zero friction in calculateCombinedFriction, then the sphere rolling smooth on the floor, and when you set for example .5 friction, then the sphere starts bouncing.

If you turn off "contact filtering" with key N, then the bouncing happens at zero friction, too. So the "internal-edge-anti-bouncing" solution works in bullet, but it seems, that it is accurate only at little friction values.

You can fire boxes with mouse, and with those bodies the situation is the same.

Now, the question is, that what is the connection between friction and "contact filtering", and why do I have to use small friction values ?

Last edited by openeye on Wed May 02, 2012 12:40 pm, edited 1 time in total.

Top

 Post subject: Re: Strange behaviour: sphere on a concave meshPosted: Tue May 01, 2012 6:42 pm

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
It is the modified version of InternalEdgeDemo in the attachment.

 Attachments: File comment: It is the modified version of InternalEdgeDemo in the attachment. InternalEdgeDemo.zip [9.23 KiB] Downloaded 100 times
Top

 Post subject: Re: Strange behaviour: sphere on a concave meshPosted: Tue Jul 10, 2012 10:41 pm

Joined: Tue Jul 10, 2012 10:38 pm
Posts: 4
I'm also seeing this problem with both the surface (btConvexHullShape) and the sphere (btSphereShape) created with m_restitution = 0.5 and m_friction = 1.0

Is the only solution to turn down the friction? The friction needs to be high in order for the ball to roll well. I'll try playing with the ball's mass to see if that helps.

Top

 Post subject: Re: Strange behaviour: sphere on a concave meshPosted: Thu Jul 12, 2012 4:06 pm

Joined: Tue Jul 10, 2012 10:38 pm
Posts: 4
Perhaps Laurent Coulon's code improvements help this stability issue we are seeing?

viewtopic.php?f=9&t=8146

I'll have to give them a try.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 7 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Google [Bot] and 5 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities