to first add capture 3d function in routine.cpp