In scientific visualization, one important application is volume visualization which is used to analyze spatial meanings of datasets. There are 4 common methods for visualizing a volume dataset: point cloud, slicing plane, isosurface, and volume render. This application implements the method of isosurface to visualize a given dataset. For simplicity, assume that the dataset is a regular 3D grid, and each grid point has a data value. The dataset contains 256 x 256 x 256 bytes of data which represents a density at a grid point of a foot.

In isosurface visualization, users select a data value, called an isovalue, and then the application will draw a 3D contour of this value. The method used for drawing an isosurface is called Marching Cubes. The 3D regular dataset grid is considered to be made of atomic cubes, and each cube has 8 corners. Each corner corresponds to a data point, and has a value. For each corner, the algorithm marks the corner is 1 if the data value at that corner is higher than the isovalue, 0 otherwise. The Marching Cubes algorithm will draw surfaces separating the 1 corners from the 0 corners. These surfaces will all join together to form an isosurface for a selected value.

How do I get set up?

  • This program is written in C++ and OpenGL. Make sure you have OpenGL library installed.
  • Compilation process
    • Windows: compile and run in IDE
    • Mac:
      g++ -Wall -o yourfile yourfile.cpp -framework OpenGL - framework GLUT
    • Linux:
      g++ -g -o yourfile -I/usr/include/GL yourfile.cpp -lGL -lglut -lm -lGLU

Viet Trinh © 2013

alt tag