m3d using c++