Yellow physics 3d

I want to ask about physics jelly ( http://www.youtube.com/watch?v=I74rJFB_W1k ), where can I find a good place to start doing such things? I want to make a simulation of a car accident, and I want to use this physics jelly, but I can not find much about them. I do not want to use the existing physics engine, I want to write my own :)

+4
source share
5 answers

Something like what you see in the video you contacted can be done using the mass-w760 system. However, since you are changing the number of masses and springs, keeping the spring constants the same, you will get wildly changing results. In short, spring mass systems are not good approximations of the continuum of matter.

Typically, these types of animations are created using the finite element method (FEM). FEM converges to a continuum, which is nice. And although it requires a little more know-how than a mass spring system, it really is not so bad. The basic idea obtained from the study of continuum mechanics can be posed as follows:

  • Break the volume of your object into many small parts (elements), usually tetrahedra . Let me call the whole set of these elements a grid. You really want to make two copies of this grid. Call one a "net of rest" and the other a "world" grid. I will tell you why the following.

  • For each tetrahedron in your world grid, measure how much it is deformed relative to its corresponding remaining tetrahedron. A measure of how it deforms is called a "deformation." This is usually done using the first measurement of the so-called deformation gradient (often denoted by F ). There are some good papers that describe how to do this. When you have F , one very typical way of defining strain (e) is: e = 1/2 ( F ^ T * F ) - I. This is called a Green strain. It is invariant to rotations, which makes it very convenient.

  • Using the properties of the material you are trying to simulate (gelatin, rubber, steel, etc.), and using the voltage that you measured in the step above, output the " stress " of each tetrader.

  • For each tetrahedron, visit each node (vertex, angle, point (they all mean the same thing)) and average the area-weighted normal vectors (in the rest of the form) of three triangular faces, share this node. Multiply the voltage of the tetrahedron by this averaged vector, and there is the elastic force acting on this node due to the voltage of this tetrahedron. Of course, each node can potentially belong to several tetrahedra, so you will need to summarize these forces.

  • Integration ! There are simple ways to do this and difficult ways. In any case, you will need to iterate over all the nodes in your world grid and divide your forces by mass to determine its acceleration. A simple way to come from here:

    • Multiply its acceleration by some small dt. This gives you a change in speed, dv.
    • Add dv to current node speed to get a new full speed.
    • Multiply this speed by dt to get the change in position, dx.
    • Add dx to the current node position to get a new position.

    This approach is known as Euler explicit forward integration . You will need to use very small dt values ​​to make it work without exploding, but it is so easy to implement that it works well as a starting point.

  • Repeat steps 2 through 5 until you want.

I forgot a lot of details and fancy additions, but I hope you can conclude that I forgot. Here is a link to some of the instructions that I used the first time I did this. The web page contains useful pseudo-code, as well as links to some relevant materials.

http://sealab.cs.utah.edu/Courses/CS6967-F08/Project-2/

The following link is also very useful:

http://sealab.cs.utah.edu/Courses/CS6967-F08/FE-notes.pdf

This is a very interesting topic, and I wish you good luck! If you're stuck, just drop me a line.

+4
source

This video for the cubic cube was made using Blender, which uses the mechanism of the bullet mechanism to simulate soft bodies. The documentation for bullets is generally very scarce and almost does not exist for the dynamics of soft bodies. It would be best to read the source code.

Then write your own version;)

+1
source

Here is a page with some good tutorials on it. You are probably in the (reverse) sections of Kinematics and Mass and Spring .

Hint: jelly can be considered as a three-dimensional cloth ; -)

Also, try looking at the search results for spring soft body pressure models - they can make you move in the right direction :-)

0
source

See this Maciej Matyka guy page , soft body theme

0
source

Unfortunately, only 2d, but maybe where to start: JellyPhysics and JellyCar

0
source

Source: https://habr.com/ru/post/1334482/


All Articles