Blender 2.42 release physics bug report

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Post Reply
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

Blender 2.42 release physics bug report

Post by John Nagle »

Tried the following situation in Blender 2.42, release version:

- Created a ground plane by stretching a cube. Marked it as an actor. Tilted the plane so that it was tilted about 25 degrees from horizontal.

- Created a smaller cube, and a cone, above the ground plane. Marked both as Actor and Dynamic.

- Marked all objects as Convex Hull Polytope and No Sleeping.

- Started game mode.

The cube falls to the ground plane, rotates to align with the ground, and stops. The cone falls to the ground plane, rotates into contact, and slides or rolls slowly, depending on initial orientation. After a few seconds, the cone goes flying upwards, violating conservation of energy, and comes back down.

All settings are at default values. Changing the mass of the cone by 10x or 0.1x has no visible effect.

I'm trying to make a spinning top that rotates, precesses, slows down, falls over, rolls, and finally comes to a stop. This is a classic check for a physics engine.

.blend file available on request. (Is there somewhere to upload bug files?)
pHalanx
Posts: 5
Joined: Wed Jul 12, 2006 3:32 am

Post by pHalanx »

Hey John,
You might want to check this out: Physics Tips

Make sure that the right bounds are set to the objects. Press "n" in the 3d-window, once the big cube is selected, and make sure that scale is 1:1:1.
You can apply the scale and rotation of an object by hitting ctrl+a

Peace
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

No, it really doesn't work.

Post by John Nagle »

pHalanx wrote:Hey John,


Make sure that the right bounds are set to the objects. Press "n" in the 3d-window, once the big cube is selected, and make sure that scale is 1:1:1.
You can apply the scale and rotation of an object by hitting ctrl+a
OK, did that and fixed the scaling. Now the cone doesn't settle, it just bounces around a bit on its side, while the cube lands and then goes flying off into space.

Where can I upload the .blend file so others can try this?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Post by Erwin Coumans »

It would be easier if you just mail the .blend file that shows the problem to bugs at continuousphysics.com

Alternatively, you can upload the .blend as part of a bugreport at the blender game engine bugtracker:

http://projects.blender.org/tracker/ind ... 9&atid=306

But this requires registration.
Thanks,
Erwin
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

Submitted bug report with .blend file

Post by John Nagle »

OK, made a bug report at http://projects.blender.org/tracker/ind ... 9&atid=306which includes a .blend file.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Post by Erwin Coumans »

A quick check of the file shows that the test is using a huge static convex. It's best to keep object sizes smaller then 10 units (meter). However, Blender is using an older version of Bullet, so the bug is likely already fixed, see the discussion here:
http://www.continuousphysics.com/Bullet ... .php?t=346

I'll check this, when I update to the most recent version of Bullet.
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

Post by John Nagle »

The reference says that no object should be bigger than 50 units, so I reduced the big static convex to 45 x 45 x 1. With that, the objects stabilized properly.

Now, on to the harder cases.

(I understand you're trying to do this in single precision. Unless you really need to be on the PS2, don't do that. You spend forever fighting scaling issues like this and explaining why it doesn't work. And you get wierd problems like physics working differently far from the origin.)
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

Post by John Nagle »

The spinning top test is working nicely. It's spinning, precessing, slowing down, falling down, rolling, reversing due to friction, and coming to a stop. I'm impressed. Few real-time physics engines get that right. Thanks.

Some minor questions:
- Where do you set coefficient of friction in the Blender interface?
- Is moment of inertia properly calculated for convex polyhedra?
- What are the units of mass and torque? (Rather than setting mass, with a default of 1, how about setting density? A good default would be 1 gm/cc, or 1000kg/cubic meter, which is a reasonable value for water and most living things. The system knows the object volume (if you use Mirtich's moment of inertia calculation, that's one of the outputs), but the user probably doesn't)

I'm really interested in friction working right, because I want to move my legged locomotion work into Blender. Foot/ground contact really matters.
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

Post by John Nagle »

Further question: How do you make a union of two convex objects without them having collision problems with each other? I tried making them a group, and that didn't work,and I tried making one a parent of the other, which didn't work either. Does that work yet?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Post by Erwin Coumans »

John Nagle wrote: Some minor questions:
- Where do you set coefficient of friction in the Blender interface?
Good question, the Blender UI is good in hiding things like this. I added an entry in the Blender Physics Tips in the Wiki:
http://www.continuousphysics.com/mediaw ... ysics_Tips
- Is moment of inertia properly calculated for convex polyhedra?
It is approximated, convex polyhedra, cylinders and cones are currently using an approximation of the local bounding box for inertia.
- What are the units of mass and torque? (Rather than setting mass, with a default of 1, how about setting density? A good default would be 1 gm/cc, or 1000kg/cubic meter, which is a reasonable value for water and most living things. The system knows the object volume (if you use Mirtich's moment of inertia calculation, that's one of the outputs), but the user probably doesn't)
The constraint solver doesn't handle mass ratios very well, and it's safest to keep masses all in the same order. Using density would create big mass ratios, which would be a burden for most blender users. However it would be nice to add some 'expert mode' with more accuracy.
Further question: How do you make a union of two convex objects without them having collision problems with each other? I tried making them a group, and that didn't work,and I tried making one a parent of the other, which didn't work either. Does that work yet?
Compounds are work in progress, and it's not possible yet to disable collisions on a pair basis yet in the Blender UI. Compounds are on the todo for 2.43. It is possible to 'fix' to 2 objects using constraints, but they need to be non-overlapping (see fixed_constraint.blend demo in http://download.blender.org/demo/test/e ... view34.zip ).

Erwin
John Nagle
Posts: 12
Joined: Tue Aug 16, 2005 7:38 pm
Contact:

Post by John Nagle »

- Is moment of inertia properly calculated for convex polyhedra?

It is approximated, convex polyhedra, cylinders and cones are currently using an approximation of the local bounding box for inertia.
Ah, that's why the spinning top looks kind of wierd.

You know about this, right? Free code for moment of inertia of a polyhedron.
http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html
Post Reply