Giter VIP home page Giter VIP logo

arap-deformation's Introduction

ARAP deformation

Description

This is a dirty implementation of As-Rigid-As-Possible Surface Modeling (SGP2007) using uniform laplacian

Use local/global method to optimize energy at each vertex i:

local optimization (fixed p' (known) to get best R1,...,Rn, use SVD decomposition to construct each Ri):

for each i to optimize this (let pi - pj = eij, p'i - p'j = e'ij):

so we need Ri=Vi*transpose(Ui) to let the stuff in (...) to be semi-positive definite symmetric to make its trace maximum, and Ui, Vi is the SVD decomposition of: (note that eij is the edge on the origin mesh, no matter how many iterations)

global optimization (fixed R (known) to get best p1,...,pn by solving a linear system), take the derivative of (1) and assume R as constant, we can get i-th equation of the system:

solving p' and R alternatively to get the best solution of p'.

Usage

Work in vs2017 release mode, after hitting the generate solution button, shader files need to be copied into x64/Release to make it work, use command ./arap.exe your/path/to/the/mesh.obj

Press w to toggle wire mode

Press d to toggle deform/select mode

Press middle mouse button to save current mesh

Press a to display/hide anchor points

Drag left mouse button to rotate mesh

Drag right mouse button to select/deform in select/deform mode

Cotangent laplacian

When I use cotangent laplacian in the deformation iteration, I got really wired result, and found it hard to make it right.

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.