Soft Body Simulation

  1. Soft Body Simulation Sonic
  2. Soft Body Simulation Sans Undertale
  3. Soft Body Simulation Blender
  4. Soft Body Simulation App

RK4, spring coef. 8000, damper coef. 20

Naruto

Overview

This project simulates a flexible cube falling on the floor, using a framework developed with C++ and OpenGL by GPLab, NCTU. For all the videos of result, please check out the last section.

The cube is constructed by a set of particles, which are connected with 3 kinds of springs. With these particles and springs, we can integrate the spring forces and damper forces to estimate the next positions for each particle. In this case, I implemented Explicit Euler Method and Runge-Kutta 4th-Order Method to solve the differential equations. This is a simple approach to simulate solid deformable objects.

Finally, because it’s a plane there, I also used a simple method to resolve the point-plane collision detection, which can bounce back the cube to the air.

Soft Body Simulation

Simulation tools for soft body dynamics including mesh collision detection, LBM fluid dynamics, smoke simulation, Bullet rigid body dynamics, and an ocean generator with waves. A particle system that includes support for particle-based hair. Real-time control during physics simulation and rendering. Soft Body Simulation. 2017-11-03 Physics. RK4, spring coef. 8000, damper coef. This project simulates a flexible cube falling on the floor, using a framework developed with C and OpenGL by GPLab, NCTU. For all the videos of result, please check out the last section. The cube is constructed by a set of particles, which are. Soft Body simulation using Ammo.js Motivation. A demonstration of soft body simulation running in the browser using ECSY (Mozilla's Entity-Component-System), Ammo.js (the Bullet physics engine compiled to WebAssembly) and THREE.js. Soft-body physics is an increasingly popular feature in videogames. This article shows how, with the additional processing power of a multi-core CPU, entire soft-body characters can be created using cloth simulation techniques. A cloth and soft body simulation library, using position based dynamics. GitHub - nitronoid/csb: A cloth and soft body simulation library, using position based dynamics.

Mass-Spring System

Cube of Particles

As the image above, these particles constructs the cube. In this simulation, it took 1000 particles to form a 10x10x10 cube. Then, the images below shows each kind of the springs connected between particles.

Structural Springs

Structural Springs connect from each particle to its 6 adjacent neighbors, including up, down, left, right, forward, backward. These springs establish the basic structure of the cube.

Shearing Springs

Shearing Springs connect from each particle to its 20 diagonal neighbors. These springs can prevent the cube from excessive shearing.

Bending Springs

Bending Springs connect from each particle to its 6 second adjacent neighbors, kind of like the structural springs but these springs skip the first neighbor instead. They can prevent the cube from folding all over.

Integration

Euler Method

Illustration of the Euler Method (from Wikipedia)

The blue curve in this graph is the unknown real values, while the red one is the approximation by Euler Method. From A0 to A1, this method only takes the status at position A0 to estimate the position after a small time step. In this case, physically, the Euler Method takes the net force at A0 and derive the acceleration to approximate the position at A1 with a small time step.

Soft body simulation unity

Because the Euler Method is a first-order method, which means it needs a rather small time step, otherwise the local error (error per step) and the global error (error at a given time) would be very big resulting in unstable system. However, the Euler Method is rather low-cost and also a basic method which is easy to implement.

Runge–Kutta 4th-Order Method

Illustration of the RK4 (from Department of Physics, Drexel University)

First, we define the following equations (h is the step size, h > 0).

  • yn+1 = yn + (h/6)(k1 + 2k2 + 2k3 + k4)
  • tn+1 = tn + h

For k1, k2, k3 and k4:

Soft Body Simulation
  • k1 = f(tn, yn)
  • k2 = f(tn + (h/2), yn + (h/2)k1)
  • k3 = f(tn + (h/2), yn + (h/2)k2)
  • k4 = f(tn + h, yn + hk3)

Which means:

  • k1 is the increment based on the slope at the beginning of the interval, using yn.
  • k2 is the increment based on the slope at the midpoint of the interval, using yn + (h/2)k1.
  • k3 is the increment based on the slope at the midpoint of the interval, using yn + (h/2)k2.
  • k4 is the increment based on the slope at the end of the interval, using yn + hk3.

The RK4 method is a fourth-order method, meaning that it’s rather high-cost and more precise than the Euler Method. It’s local error is on the order of O(h5), while the global error is order O(h4).

Collision Detection

There is one thing left to handle is the point-plane collision when the cube is falling right on the plane. For every particle, once it satisfies the following conditions, it would be considered that the collision is happening.

  • The particle’s position is close enough to the plane.
  • The particle is moving toward the plane.

When the particle and the plane are collided, the system would revert the normal component of the velocity. A coefficient smaller than 1 to represent the energy loss could be applied to the reverted velocity. So this is an simple way to handle the point-plane collision.

Results

  • Euler Method, spring coef. 8000, damper coef. 20
  • Euler Method, spring coef. 800, damper coef. 60

Soft Body Simulation Sonic

  • RK4, spring coef. 8000, damper coef. 20
Quick guide
Navigation
  • Click+drag with the mouse to rotate, scroll to zoom.
  • Or use the buttons in the upper left. The Home button resets the view.
  • Change from Capsule to Orbit mode in the upper right to enable full 3d
  • rotation and hold Ctrl down to pan the view. (Premium users only)
Slider
  • Use the opacity slider on the left to reveal layers.
  • Click on the toggle below the slider to control layers individually.
Selection
  • Use the searchbox at the upper right to search, or click on entities to select them.
  • Click on the background or on the X to undo selection.
  • Ctrl+click on entities to quickly hide entities. (Cmd+click on mac.)
  • Shift+click on entities or labels (or click on the 'pin' icon in a label) to pin an entity. This will keep it selected while you select more.
  • Use the visibility icon on an entities name to hide an item. Unlike Ctrl+clicking an entity the visibility tool will leave hide the items until 'Unhide All' is clicked on the upper right.
  • Use the 'Zoom to' tool on the items name to center the view on the item.
  • Use the down arrow on the items name to reveal information about the item.
  • Use the 'Pin' tool on the items name to pin an item allowing you to select multiple items.

Soft Body Simulation Sans Undertale

Models
  • Use the model select icon above the anatomy slider on the left to load different models.
Premium Tools
  • My Scenes allows you to load and save scenes you have created. All annotations, pins and visible items will be saved.
  • Zygote Scenes is a collection of scenes created by Zygote Media Group with annotations identifying anatomical landmarks.
  • Hierarchy is a list of all the entities you have in your current scene. You can turn parts on and off using the check marks by each object or group of objects.
  • Annotations allows you to create your own notes and markers that will be saves when you save your scene.
  • Tools:
    • Pick returns you to the default mode of picking parts and rotating your camera.
    • Slice allows you to slice the parts in your scene in either an X, Y or Z plane.
    • Explode moves all the parts in your scene away form a central point that you can interactively position.
    • Quiz when enabled when you pick a part rather than displaying the part's name a multiple choice menu will appear allowing you to quiz yourself.

Soft Body Simulation Blender

Professional Tools

Soft Body Simulation App

  • The snapshot icon at the top center will take a snapshot of your scene that can then be saved as a jpg or drawn on with the included pen tools.