8000 GitHub - superpdm/ShellMaps: C++ implementation of Shell Maps[ToG 05]
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

superpdm/ShellMaps

 
 

Repository files navigation

A simple implementation of Shell Maps

'A shell map is a bijective mapping between shell space and texture space that can be used to generate small-scale features on surfaces using a variety of modeling techniques. The method is based upon the generation of an offset surface and the construction of a tetrahedral mesh that fills the space between the base surface and its offset'. (Defined in paper 'Shell Maps', tog 05).

This is a personal implementation based on the original paper. The project builds on nanogui for OpenGL viewing and Eigen for basic numerical computing.

Description

The input can be a wavefront .obj file with uv coordinates, the procedure to generate shell maps has following steps:

  1. Offset surface generation.

    • Compute vertex normals to generate an offset surface(mesh)
    • Compute a tangent space for transforming vectors in textures
    • The surface intersection is not detected now
  2. Prims and Tetrahedra Construction.

    • Generate prisms in shell space by connecting the vertices of triangles in base surface with correspoding triangles in offset surface
    • Split prims into three tetrahedra to keep convexity
  3. Maintaining Continous Tetrahedral Meshes

    • Each prism can be split into three tetrahedra in six ways. Some spliting ways may result in inconsistency between adjacent prims. A DFS style searching is used to solving this.

Finally, a shell map can be generated. There is no well defined format to store this structure in original paper. And this implementation saves shell maps in the format found in code(src/volume/tetra.h) of ctcloth12.

Compiling

You can compile this project like that in nanogui. Since nanogui currently works on Mac OS X (Clang) Linux (GCC or Clang) and Windows (Visual Studio ≥ 2015), it requires a recent c++11 capable compiler. All dependencies are jointly built using a CMake-based build system.

Usage

Screenshot

To get started, launch the binary and select a wavefront .obj file using "Open" button.

Then, a simple workflow can be,

  • Set offset value by adjusting slider under "offset value" panel
  • Click "Generate" button to generate offset surface
  • Click "Compute" button to compute splitting pattern
  • Click "Construct" button to construct tetrahedron mesh
  • Click "Save shell" button to save shell maps in a text file
  • Click "Save bound" button to save the bounding mesh of shell space in a wavefront .obj file

Additionally, several different rendering layers can be selected for viewing and debugging.

About

C++ implementation of Shell Maps[ToG 05]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 81.0%
  • C++ 17.8%
  • Other 1.2%
0