Git Product home page Git Product logo

deformation-transfer's Introduction

TITLE: Deformation Transfer in ANSI C

Demonstration

What's This?

This is an implementation of Deformation Transfer algorithm in ANSI C, which could transfer the deformation of one triangle mesh to another. Check this paper (http://people.csail.mit.edu/sumner/research/deftransfer/Sumner2004DTF.pdf) for detailed explaination of this algorithm and here (http://people.csail.mit.edu/sumner/research/deftransfer/) for demonstrations and mesh data.

Compile

On MacOS (Tested on MacBook Pro M1):

  1. install deps:
brew install freeglut glfw
brew install suite-sparse
  1. set the paths to opengl/suite-sparse/freeglut in ./makefile.mk, e.g.
OPENGL_INC_DIR = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers
SUITE_SPARSE_DIR = /opt/homebrew/Cellar/suite-sparse/5.10.1
FREEGLUT_DIR = /opt/homebrew/Cellar/freeglut/3.2.1_1/
  1. make

  2. run sample_run.sh for testing.


Deprecated

You need CHOLMOD (http://www.cise.ufl.edu/research/sparse/cholmod/) and UMFPACK (http://www.cise.ufl.edu/research/sparse/umfpack/) to compile it, drop the header files and libs to the ./external folder if you've compiled them on your own, or just try the precompiled version in this repository.

After these libs has been set properly, type =make= to build them all.

Try A Shakedown Run

Run ./sample_run.sh, the resulting deformed target model would be shown by our corrstool. The calculation takes about one minute or so (resolving corresponence and deforming 10 models).

[[https://github.com/Golevka/deformation-transfer/raw/master/RESULTS/shakedown_run.png]]

You can read the comments in sample_run.sh to see how to apply these tools to your own .OBJ models.

Usage of Corrstool

Correspondence phase: You need to pick up a small set of marker points to specify the semantic correspondence between the source model and the target model, we provided a tool here (corrstool), you can launch it using

    ./bin/corrstool source_model target_model

for example, running this command in bin directory

    ./bin/corrstool ./data/horse_ref.obj ./data/camel_ref.obj

would open a window showing the source model at the left panel and target model at the right panel, drag your mouse with left mouse button pressed to view the model in a different angle (it would change the view angle of the two panels simutanously), and drag with right mouse button pressed to zoom the view.

Corrstool

You can move the cursor to somewhere in the model you want to mark and press =P= to mark this point, after having specifed marker points on both models, press =A= to "commit" this point pair to correspondence list, if you hit =A= by mistake, just hit =U= (undo) to recover from that.

The points you picked up may not right on where your cursor pointed to, this is because of marker points can only appear on vertices of the mesh model, you can view models in wired mode by pressing =M=, and strike it again to get back to solid mode. If you want to switch to another point on the same piece of triangle, just hit =C= many times until you get what you want.

[[https://github.com/Golevka/deformation-transfer/raw/master/RESULTS/wired_mode.png]]

After all marker points has been specified, press =W= to write the correspondence to a .cons file (default.cons by default).

deformation-transfer's People

Contributors

golevka avatar walkoncross avatar

Watchers

 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.