For CrystalBlend: question about physics


(jorrit) #1

Blender uses the following physical attributes for rigid body objects:

  • Mass
  • Form Factor
  • Dampener
  • Rotational Dampener
  • Anisotropic

Who can explain to me what they mean and more importantly how to map those on the physics system used by ODE. ODE has the following parameters for physical objects:

  • Mass
  • Friction
  • Elasticity
  • Density
  • Softness
  • Lift
  • Drag

Greetings,[/i]


(Fred_Pyo) #2

(Sorry I’m not helping much in this post)

Also consider that under “Materials”, when you click on the “DYN” button you’ll also find other Physical atributes of the object, such as Restitution (Elasticity of collisions?), Friction, and others…

Doing a quick search on mass and stuff, I found this link:
http://download.blender.org/documentation/NaN_docs/BlenderGameReference/realtimebuttons.html


(calli) #3

Because I wrote the article Fred_Pyo is mentioning I could not add much more to this topic.

Maybe a word for the Form-factor: It mainly controls the rolling of a dynamic object, I dont know if it has a physical correspondence in reality maybe another hack as so many others.

Maybe also look at:

http://download.blender.org/documentation/NaN_docs/BlenderGameReference/dynmaterials.html

which explains the DYN-Settings for gameengine materials.

Regards,
Carsten


(jorrit) #4

I need some more help with this then just references to articles. I’m really very inexperienced with physics so I don’t know what half the terms mean. Nobody here who is willing to help me with this and give me the conversion parameters that I require?

Greetings,


(JD-multi) #5

Hello Jorrit.

Personally I don’t know a lot about game engines, but I’m trying to figure out things in general. Even I can’t tell you what this all means. But let me try a few:

  • Mass: the weight of an actor, make is heavier or lighter.
  • Form Factor: ??
  • Dampener: I think something that makes movements fade out. Like you move and when you stop is slightly moves a little further, so it damps out.
  • Rotational dampener: same as above but then for rotation.
  • Anisotropic: ??
  • Friction: Wasn’t that an option to make objects move on slopes ?
  • Elasticity: When you do this, the object flies a little above the ground, so when you jump it goes up, and when ti comes down is does some kind of elastic fade out of the jump. Not like go up and when down stop directly.

Further I have no idea. I hardly think these which I described are even true. Jorrit the best thing would be joining Blender irc channel on irc.freenode.net called #blendercoders and ask some people there.

About developing the game engine. Please don’t code blindly all those blender functions in CrystalBlend. Most of them are useless or even not used. I would suggest you before continue the developement of CrystalBlend to get rid of questions you have. Then do some kind of research in general about what people want to see or want to have in the game engine and which functions they use now in blender’s engine.

What I see now is that you try all those blender functions to work in CrystalBlend, not even known if people really use them. I would also suggest to make it work with the basic things from blender first. And slowly develope step by step a few options. So people start to make realtime stuff in it, and make for them a sort of wishlist so you can filter out those needed things and every month do a little update.

Anyways, the best way to get some help on this project is joining the #blendercoders irc channel. I’m sure you will find there what you need, and sure they want to help you as well. Elysiun is not really a coders forum, it’s great for users feeback, but that’s all, the real technical guys are on blender.org forum and #blendercoders. :smiley:


(calli) #6

Much wrong things above…

  • Form Factor, see my post above
  • Anisotrophic: Friction is calculated directional, think of a ice-skate, very few friction in driving direction, much in the other, you can set 3 factors in Blender for every axe
  • Elasticity: we call it restitute in Blender, 1.0 makes an object bounce forever, 0.0 not bound at all
    Friction: Well, friction is friction… ice has i.e. very few friction, rubber on tar very much etc.

Much of that is explained in the links above, but I dont know very much about ODE, so I cant comapare/translate.

Carsten.


(gorgan_almi) #7

Wrong! Sorry…

- Mass: Mass is a fundamental property of all objects. It’s the value that’s normally quoted in Kilograms if you’re metric. It is NOT the same as weight, which is the force on an object due to gravity. The mass of an object does NOT affect the speed it falls at under gravity. Mass is useful for calculating the final velocity after a collision. Basically simple collisions obey the equation…

m1*u1 + m2*u2 = m1*v1 + m2*v2

…where m is the mass of the 1st and second objects, u is the initial velocity, and v is the final velocity. This assumes that the collision is completely elastic (see below).

Mass is also used for converting a force to an acceleration…

F = m*a

…where F is the force, m is the mass and a is the acceleration.

In reality mass is also used to calculate the frictional force on slopes, but blender seems to use a hack instead of doing that. It’s probably best to do it the real way rather than copy blender’s hack.

- Modulus of Elasticity: This is one of the options under DYN in the Material settings. It controls the amount of energy lost in a collision. It is a value between 0.00 and 1.00, where 0.00 is complete energy loss (completely unelastic collision), and 1.00 is no energy loss (completely elastic collision). Basically it is used to reduce the final velocity of an object or objects after a collision…

(m1*u1 + m2*u2) * e = m1*v1 + m2*v2

…where e is the modulus of elasticity.

- Friction: This is another one of the options under DYN in the Material settings. Friction on a horizontal surface is really simple, it basically changes the relationship between a force and the resulting acceleration…

F - fr = m*a

…where F is the force, fr is the friction, m is the mass and a is the acceleration. Note that this is only true when it would not make the object move backwards.

Friction on a slope is a little more complex. I don’t have time to write about it and all the others right now but let me know if you think you’ll find this useful and I’ll finish up the others sometime. :slight_smile:

Keith. 8)


(JD-multi) #8

Hehe, jorrit, you’ve got what you asked for :wink:
I’m not such a technician, so I thought well if someone doesn’t reply, I’ll try. But it seams now that it worked what I thought. :slight_smile:


(goldentaiji) #9

:wink: Woot go gorgan_almi!!

Jason Lin


(gorgan_almi) #10

Time for the next quick installment… :slight_smile:

-Friction con’d: In my last installment I said that for friction on a horizontal surface…

F - fr = m*a

…where F is the force and fr is the friction. fr can be calculated using the following formula…

fr = meu * m * g

…where meu is the coefficient of friction (thats the friction value in the Material’s DYN Settings), m is the mass and g is the gravitational acceleration (from the World Settings)

-Friction on a slope: Friction on a slope uses the same formula as before…

F - fr = m*a

…where F and fr are parallel to the slope (local axis forces), but this time the frictional force fr is calculated using…

fr = meu * m * g * Cos(theta)

…where theta is the angle of the slope above the horizontal.

-Anisotropic Friction: This is an important game engine concept which causes an object to have different friction in different directions. For example a skateboard should have a lot less friction forwards-backwards than it should have side-to-side. Basically anisotropic friction gives you 3 values between 0.00 & 1.00, one for each local axis. The coefficient of friction (meu) is multiplied by the anisotropic friction value for each axis before the value of the frictional force for that axis is calculated.

-Movement damping / Rotational damping: These are simply values that control how the linear & rotational speed of an object are reduced over time in the game engine. They are used to simulate air resistance etc. I’m not sure exactly how they are applied mathmatically, but basically linear / angular speed would be divided by the damping value at regular intervals.

-Form Factor: This is a hack and doesn’t have any equivalent in the real world. I’m not really sure how it works, but I gather its purpose is to dampen collisions somehow? I’m really not sure.

-Interaction: Just thought I’d mention these here…
. . . . Modulus of Elasticity (e): When two objects with different elasticities collide, the effective modulus of elasticity for the collision will be e1 * e2.

. . . . Coefficient of Friction (meu): When two objects with different frictional coefficients slide past one another, the effective coefficient of friction will be meu1 * meu2.

I’d be more than happy to help out as a physics engine consultant or something like that in CrystalBlend. I’m also learning practical C++ so I may be able to help out with coding as well. But please please please let me know if you’re not finding this helpful… :-?

Keith. 8)


(jorrit) #11

Thanks for all the information so far. I will soon have a look and see how I can consolidate that information into code for CrystalBlend :slight_smile:

Greetings,


(Al_Capone) #12

where the hell is “Elasticity” mention in Blender ?


(gorgan_almi) #13

The actual term blender uses is “Restitution”. It’s in the DYN settings in the Materials window. If you hover the mouse over it, a tooltip will pop up saying “Elasticity of collisions” :slight_smile:

Keith. 8)