func MarchingCubes(volume Volume, extents math3d.Vector, cubeSize float32) *render.Mesh {
	defer util.EndTiming(util.StartTiming("MarchingCubes(%v, %v, %v)", volume, extents, cubeSize))

	var verticies []math3d.Vector
	var x, y, z float32

	if cubeSize <= 0 {
		panic("Cube size was 0 or negative!")
	}

	// FIXME, seed at the start of the game
	r := rand.New(rand.NewSource(100))

	finalMesh := new(render.Mesh)

	for x = 0; x < extents.X; x += cubeSize {
		for y = 0; y < extents.Y; y += cubeSize {
			for z = 0; z < extents.Z; z += cubeSize {
				verticies = marchCube(volume, x, y, z, cubeSize)

				for _, vertex := range verticies {
					finalMesh.VertexList = append(finalMesh.VertexList, vertex.X)
					finalMesh.VertexList = append(finalMesh.VertexList, vertex.Y)
					finalMesh.VertexList = append(finalMesh.VertexList, vertex.Z)

					finalMesh.ColorList = append(finalMesh.ColorList, r.Float32())
					finalMesh.ColorList = append(finalMesh.ColorList, r.Float32())
					finalMesh.ColorList = append(finalMesh.ColorList, r.Float32())
				}
			}
		}
	}

	return finalMesh
}