mpri-graphics-project/MarchingCubes.cpp

34 lines
770 B
C++
Raw Normal View History

#include "MarchingCubes.hpp"
MarchingCubes::MarchingCubes(
const ImplicitSurface& surface,
const Cuboid& box,
double resolution):
surface(surface),
box(box),
resolution(resolution)
{}
void MarchingCubes::add_hint(const Cuboid& hint) {
hints.push_back(hint);
}
Mesh MarchingCubes::operator()() {
Mesh output;
for(double x = box.low(0); x < box.high(0) + resolution; x += resolution)
{
for(double y = box.low(1); y < box.high(1) + resolution;
y += resolution)
{
for(double z = box.low(2); z < box.high(2) + resolution;
z += resolution)
{
//TODO apply marching cube indeed
}
}
}
return output;
}