C++ Qt Graphics Modeling

Marching cubes

Academic SOLO project

Description

Implementation of the Marching cubes algorithm (built on Qt) able to create a triangular mesh from volumetric data and a given surface isovalue.
Lab project for the advanced 3D modeling course in MIRI, at UPC.

Animation demo

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