santipaprika / marching-cubes

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

About

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


Languages

Language:HTML 65.5%Language:C++ 31.9%Language:JavaScript 1.1%Language:CMake 0.5%Language:C 0.4%Language:Makefile 0.3%Language:CSS 0.2%Language:TeX 0.1%Language:Shell 0.0%Language:QMake 0.0%