Giter Site home page Giter Site logo

timjj22 / caaocorbsviem Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 1.02 MB

Project implementation of the "Collision-Aware and Online Compression of Rigid Body Simulations via Integrated Error Minimization" paper from SCA 2018

License: GNU General Public License v3.0

C++ 99.76% CMake 0.24%

caaocorbsviem's Introduction

Collision-Aware and Online Compression of Rigid Body Simulations via Integrated Error Minimization

This is a project implementation of CAaOCoRBSvIEM. .dmat files are easily read by both libigl and gptoolbox and are simple raw matrix formats.

Additional data can be provided to the compressor for contact events between objects. This allows for better collision detection and compression results. The input data is specifed within the json file.

The uncompressed data format is stored in the following way:

 t₀  t₁  t₂  ̇⋯  tₙ

 q₀  q₀  q₀     q₀
 p₀  p₀  p₀     p₀

 q₁  q₁  q₁     q₁
 p₁  p₁  p₁     p₁

 ⋮          ⋱
 
 qₘ  qₘ  qₘ     qₘ
 pₘ  pₘ  pₘ     pₘ

where each of the n columns is a frame from the simulation, for each of the m objects stacked quaternion and position. Each frame fo the simulation is defined in a (7*m + 1) vector, stacked to include n frames.

The compressed data format is slightly different, but is stored in a similar way. Each of the m objects are stored in separate compressed files, and the quaternions are stored separately as well.

The rotation files: #QcState.dmat

Each column in this file is a keyframe for the data with the times and quaternion and angular velocity. The time in the column of the keyframe outlines the time when the keyframe ends (coefficients Xᵢ are valid for the window [tᵢ₋₁ tᵢ])

 t₀    t₁    ⋯    tᵢ
 α₀    α₁         αᵢ
 qx₀   qx₁        qxᵢ
 qy₀   qy₁        qyᵢ
 qz₀   qz₁        qzᵢ

notice how only 3 components of the quaternion are stored, they are saved in such a way that qw = sqrt(1 - qx² - qy² - qz²) (guaranteed to be positive). The α is the angular velocities between the keyframes (in so-called "normalized" time, where the time at the start and end of the keyframes are 0 and 1 respectively), this way multiple spins around an axis can be encoded. In order to avoid numerical issues with the quaternion packages, simple slerps are used if the angular velocity term is too small.

The position files: #PcState.dmat

Each column in the file is a keyframe with the times and positions and velocities. The positions are reconstructed from the following quadratic: p(t) = αt² + ̱βt + γ, again in normalized time. The data is stored as shown:

 tᵢ    ⋯    tᵢ₊₁
 βᵢ         βᵢ₊₁
 γᵢ₊₁       γᵢ₊₂

Endpoints at the end of the current keyframe and the start of the next are the same, and so the quadratic can be reconstructed as αᵢ₊₁ = γᵢ₊₂ - γᵢ₊₁ - βᵢ₊₁

caaocorbsviem's People

Contributors

timjj22 avatar

Stargazers

Ex-Film-Student avatar Arya Rafii avatar Fabio Dias Rollo avatar Xiaolong  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.