GithubHelp home page GithubHelp logo

santipaprika / marching-cubes Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 37.94 MB

Lab project for the advanced 3D modeling course in MIRI, at UPC.

Makefile 0.27% QMake 0.01% C++ 31.93% C 0.41% CMake 0.50% HTML 65.53% CSS 0.17% TeX 0.07% Shell 0.03% JavaScript 1.10%

marching-cubes's Introduction

Marching cubes

Lab project for the advanced 3D modeling course in MIRI, at UPC. Implementation of the Marching cubes algorithm (built on Qt).

Animation demo

marching-cubes-demo.mp4

How to set-up

Use any UNIX terminal to navigate to the Mesh Viewer directory, create a new build directory and run the makefile:

>> cd MeshViewer_73156e6
>> mkdir build
>> make -j

Finally, run the actual application:

>> ./MeshViewer

Application use

Compute isosurface

Isosurface computation can be achieved by right-clicking inside the program window and selecting Compute Volume Isosurface. Then, the explorer will open so that an actual volume file can be chosen.

Volume file format

The required volume format is a text file (.txt) consisting of N3 + 1 lines, each line containing a number, so that the first line contains N (the size of the voxelization, which is the same in all three dimensions), and the following lines contain the values of the scalar field sorted so that the value for voxel (i; j; k) is at line iN2 + jN + k + 1 (lines numbered starting at zero, which is the line containing N).

Sample volume files can be found in the Data folder.

Isovalue

The attached marching cubes implementation will set the isovalue to the minimum value in the volume by default.
This can be changed by passing the desired isovalue as input argument, for instance:

>> ./MeshViewer -2

Rendering animation

When the Animate button is pressed, the program will increase the isovalue progressivelly, storing each output as separate images which can be found in the img folder. Afterwards, a video can be built using any external software. In case of ffmpeg:

>> ffmpeg -framerate 24 -i %d.png -pix_fmt yuv420p ../out.mp4

Dependencies

The external libraries being used are already included in the repository, so no further integration step is needed:

marching-cubes's People

Contributors

santipaprika 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.