• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created over 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Real-Time Locomotion on Soft Grounds with Dynamic Footprints - 2022 - Frontiers in Virtual Reality

Real-Time Locomotion on Soft Grounds with Dynamic Footprints

teaser

Introduction

This repository provides the codes used to reproduce the results shown in the following paper: Real-Time Locomotion on Soft Grounds with Dynamic Footprints. Eduardo Alvarado, Chloรฉ Paliard, Damien Rohmer, Marie-Paule Cani.

Our system takes as input a character model, ie. a mesh geometry, a rigged skeleton with kinematic animations and an IK system applied to the feet bones, on top of a simple proxy-geometry and rigid body used for balance control and collision processing. Then, it builds a real-time locomotion model that combines a global controller to adjust the overall character pose based on the ground slope, enabling tilting and balancing behaviors, with an IK system to adapt the model to non-flat terrains.

In order to reproduce two-ways interactions between the model and the environment, the character deforms the soft ground based on a custom-made light-weight force model for feet-to-ground contact, driven by the kinematics on the input motion and the nature of the terrain. Finally, a versatile model based on Hooke's law is used for ground deformation, parametrized by the Young modulus in compression and by the Poisson ratio in lateral material displacement.

ย  ย 

ย  ย 

Figure 1: Examples of footprints caused by different character morphologies in various ground types, such as snow or sand.

Real-time Terrain Deformation

We propose a model for the forces that the character applies to the ground when its feet are in contact with it, based on its kinematics and the nature of the ground. The resulting interaction forces over time are used to compute a plausible ground deformation.

The static forces that the model exerts on the ground are estimated based on the character's mass m, the contact area between the feet and the ground and the balance described by the contribution of each foot to the character's weight. In addition, a dynamic force model during contact takes into consideration the force that each foot generates due to its change of momentum when it lands into the ground with certain velocity. In order to define the time needed for the character to be fully stopped by a given type of terrain, we introduce an external parameter called the characteristic time ฯ„. Therefore, a given forward kinematics motion provided as input can be associated to different forces, ie. a large magnitude of momentum force on a hard terrain with small ฯ„ value, and small force magnitude with long effect on a soft terrain with large ฯ„.

Figure 2: Forces generated during the kinematic motion. Blue: weight - Red: momentum forces - Black: foot-to-ground forces.

Finally, we use a linear plastic model for terrain compression along with a ray-casting method to map the estimated forces into the respective ground deformation. Parameters such as the Young Modulus of Elasticity E or Poisson ratio ฮฝ can be modified to change the behavior of the terrain under deformation.

For more information about the method and mathematical background behind the approach, please refer to the paper.

Instructions

The repository contains all the necessary assets to run the project without additional material. The last version has been tested on the Unity version 2020.3.21f1. Inside the Assets, the following structure is introduced:

.
โ”œโ”€โ”€ ...
โ”œโ”€โ”€ Assets 
โ”‚   โ”œโ”€โ”€ ...		
โ”‚   โ”œโ”€โ”€ Materials           # Materials used for models/grounds
โ”‚   โ”œโ”€โ”€ Models              # Character models containing animation clips, state-machines or rigs
โ”‚   โ”œโ”€โ”€ Scenes              # Scenes ready-to-use
โ”‚   โ”œโ”€โ”€ Scripts             # .cs scripts for terrain deformation
โ”‚   โ”œโ”€โ”€ Terrain Data        # Data files corresponding to terrain heightmaps
โ”‚   โ”œโ”€โ”€ Textures            # Textures used for models/grounds
โ”‚   โ””โ”€โ”€ ...                
โ”œโ”€โ”€ Docs
โ”œโ”€โ”€ ...				
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ LICENSE

Go to Assets > Scenes and open the Terrain Deformation scene. Click in the play button, and after that, select the Game Object Terrain in the Hierarchy to trigger on the deformation system. In the Game window, you will find an environment where you can move your character, along with an interface to modify the terrain deformation parameters.

Figure 3: Demo interface for terrain deformation.

In order to start deforming the terrain while you move, make sure that the option Deformation in the upper-left corner is active. If you want to activate the lateral dispacement, select the opcion Bump. To activate the post-processing step using Gaussian Blur, activate Post-processing. The options are:

  • Terrain Options:
    • Young's Modulus E: Defines the elastic constant of the terrain, measured in [Pa]. It has a direct impact on the terrain compressibility. Smaller values lead to more compressible terrains, and therefore deeper deformations.
    • Contact Time ฯ„: Defines the characteristic time of the terrain, measure in [s]. It is the time needed for the character to be fully stopped by a given type of terrain, during which the ground exerts a reaction force. Larger values lead to smaller force values during a larger period of time, while smaller values lead to stronger reaction forces during a short period of time.
    • Poisson Ratio ฮฝ: Defines the amount of volume preserved at the end of the deformation, and is adimensional. An ideal incompressible material has a Poisson ratio of 0.5. This will cause a larger bump while the option is active, as the volume during the deformation is totally preserved. As the value of ฮฝ gets smaller, the material compresses and the amount of volume displaced on the outline of the footprint will be lower.
    • Gaussian Iteratons: Number of iterations for the Gaussian Blur filter. Larger values lead to smoother footprint results.
  • Show:
    • Raycast Grid: Displays raycast method to estimate the contact area between the ground and the feet.
    • Bump: Displays contour of the footprint.
    • Wireframe: Switches to wireframe mode to show the 3D terrain mesh and the deformations.
    • Forces: Displays force model from the kinematic animation in real-time.
  • Forces: Prints the values for weight, momentum forces and ground reaction forces per foot. Measured in [N].
  • Deformation: Prints the values for the feet positions, number of ray hits used to calculate the contact area, pressure per foot measured in [N/mยฒ] and compressive displacement per foot measured in [mm].

In order to reset the terrain, just select Terrain in the Hierarchy and use the Set Height brush in the Terrain Component in the Inspector. Then, set the Height value to 1 and paint the terrain to reset it (while the application is not playing).

In the folder Scenes, you can find the scene Terrain Deformation - Showcases. This scene contains three types of grounds (snow, sand and mud), defined by different parametrization. When the character moves though these terrains, the system will switch automatically based on the material where the character is stepping in, changing the deformation appearance.

For more information about the values for each type of material, please refer to the paper.

Results

Citation

@article{10.3389/frvir.2022.801856,
title = {Real-Time Locomotion on Soft Grounds With Dynamic Footprints},
author = {Alvarado, Eduardo and Paliard, Chloรฉ and Rohmer, Damien and Cani, Marie-Paule},
doi = {10.3389/FRVIR.2022.801856},
journal = {Frontiers in Virtual Reality},
volume = {3},
pages = {3},
year = {2022},
month = {mar},
copyright = {All rights reserved},
issn = {2673-4192},
url = {https://hal.inria.fr/hal-03630136},
urldate = {2022-04-05}
}

Links

License

The code is released under MIT License. See LICENSE for details.

More Repositories

1

unity-antagonistic-controller

Generating Upper-Body Motion for Real-Time Characters Making their Way through Dynamic Environments - 2022 - SCA
C#
113
star
2

unity-soft-walks

Soft Walks: Real-Time, Two-Ways Interaction between a Character and Loose Grounds - 2021 - Eurographics (short)
C#
47
star
3

TRAIL-Natural-Impact

TRAIL: Simulating the Impact of Human Locomotion on Natural Landscapes - 2024 - Computer Graphics International (CGI)
C#
10
star
4

unity-animation-and-beyond

Unity tutorials, examples and techniques for Animation in Unity
C#
9
star
5

unity-animation-course

[Udemy] The Beginner's Guide to Animation in Unity (v5 to v2019.2)
C#
7
star
6

cpp-opengl-cmake-tutorial

C++/OpenGL Project Building Tutorial with CMake
C++
5
star
7

pbr-materials-course

[Udemy] The Secrets to Photorealism: The PBR/Blender 2.8 Workflow
4
star
8

inf633-2021-2022

INF633 - Advanced 3D Graphics (2021-2022) - Lab Course
C#
3
star
9

inf633-2022-2023

INF633 - Advanced 3D Graphics (2022-2023) - Lab Course
C#
2
star
10

unity-3D-dev-course

[Udemy] Complete C# Unity Game Developer 3D
C#
2
star
11

unity-2D-dev-course

[Udemy] Complete C# Unity Developer 2D: Learn to Code Making Games
C#
2
star
12

ue5-dev-course

[Udemy] Unreal Engine 5 C++ Developer: Learn C++ & Make Video Games
2
star
13

cg-cse167x-course

UC San DiegoX: CSE167x - Computer Graphics
C
1
star
14

gan-mnist

Simple GAN for MNIST
Python
1
star
15

hello-world

Introduction to GitHub
1
star
16

blender-character-creation-course

[Udemy] Blender Character Creator for Video Games Design
1
star
17

tensorflow2-course

[Udemy] Tensorflow 2.0: Deep Learning and Artificial Intelligence
Python
1
star
18

space-breaker

Space Breaker - Unity 2D Game for WebGL
CSS
1
star
19

tensorflow-bootcamp

[Udemy] Complete Guide to TensorFlow for Deep Learning with Python
Jupyter Notebook
1
star
20

reinforcement-learning-course

Winter Semester 2018/2019 - Albert-Ludwigs-Universitรคt Freiburg
Python
1
star
21

robocup-logistics-league

Summer Semester 2017 - Albert-Ludwigs-Universitรคt Freiburg
1
star
22

deep-learning-lab

Winter Semester 2017/2018 - Albert-Ludwigs-Universitรคt Freiburg
Python
1
star
23

cpp-programming-course

[Udemy] Beginning C++ Programming - From Beginner to Beyond
Makefile
1
star
24

python-3-bootcamp

[Udemy] 2020 Complete Python Bootcamp: From Zero to Hero in Python
Jupyter Notebook
1
star
25

pytorch-course

[Udemy] PyTorch for Deep Learning with Python Bootcamp
Jupyter Notebook
1
star
26

ML-with-PyTorch-and-Scikit-Learn

[Book] Machine Learning with PyTorch and Scikit-Learn
1
star
27

edualvarado.github.io

The HTML/CSS/JS source code for my old version homepage. New version: https://edualvarado.com/
CSS
1
star
28

edualvarado

My personal README.md!
1
star
29

deep-learning-course

Winter Semester 2018/2019 - Albert-Ludwigs-Universitรคt Freiburg
Jupyter Notebook
1
star